Add SOONG_DISABLE_CLIPPY environment variable
This environment variable will be used for testing the Rust toolchain for correctness before updating the Android codebase to resolve new lints. Test: Introduce lint Test: SOONG_DISABLE_CLIPPY=true m out/soong/.intermediates/frameworks/minikin/rust/libminikin_rust_ffi/android_arm_armv8-a_rlib_rlib-std/libminikin_rust_ffi.rlib.clippy Change-Id: If7236c7f16a3e0a0b27a90577211549f2dc1a344
This commit is contained in:
@@ -38,11 +38,14 @@ func (c *clippy) props() []interface{} {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *clippy) flags(ctx ModuleContext, flags Flags, deps PathDeps) (Flags, PathDeps) {
|
func (c *clippy) flags(ctx ModuleContext, flags Flags, deps PathDeps) (Flags, PathDeps) {
|
||||||
enabled, lints, err := config.ClippyLintsForDir(ctx.ModuleDir(), c.Properties.Clippy_lints)
|
dirEnabled, lints, err := config.ClippyLintsForDir(ctx.ModuleDir(), c.Properties.Clippy_lints)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ctx.PropertyErrorf("clippy_lints", err.Error())
|
ctx.PropertyErrorf("clippy_lints", err.Error())
|
||||||
}
|
}
|
||||||
flags.Clippy = enabled
|
|
||||||
|
envDisable := ctx.Config().IsEnvTrue("SOONG_DISABLE_CLIPPY")
|
||||||
|
|
||||||
|
flags.Clippy = dirEnabled && !envDisable
|
||||||
flags.ClippyFlags = append(flags.ClippyFlags, lints)
|
flags.ClippyFlags = append(flags.ClippyFlags, lints)
|
||||||
return flags, deps
|
return flags, deps
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user