diff options
author | 2024-09-12 15:37:34 -0700 | |
---|---|---|
committer | 2024-09-12 15:37:34 -0700 | |
commit | abc17eac1a8f5f0d6fa3f17fc42ee49288933eaf (patch) | |
tree | dee8429b44c8f97635ae0d525f1aec61a3874ef2 | |
parent | 167230037c312acbdef1994702f39091dcffbe0a (diff) |
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
-rw-r--r-- | rust/clippy.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/rust/clippy.go b/rust/clippy.go index 6f0ed7ff1..426fd7393 100644 --- a/rust/clippy.go +++ b/rust/clippy.go @@ -38,11 +38,14 @@ func (c *clippy) props() []interface{} { } 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 { 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) return flags, deps } |