lint scopes
a9447e8fc1f69caee25e220d5cdb40a0a601e12e
Oliver Jan Krylow <oliver@bugabinga.net> ·
unsigned
- Parent 1: 909e06b38cb9
There are many coding harnesses - but this one is fast
a9447e8fc1f69caee25e220d5cdb40a0a601e12e
Oliver Jan Krylow <oliver@bugabinga.net> ·
unsigned
+73 / −26 text lines
+6 / −0 text lines
+1 / −0 text lines
- Lint scopes: production strict with a curated high-signal allow-list; tests relax assertions and pedantic; guest crates stay strict on their wasm target.+0 / −1 text lines
+0 / −1 text lines
+0 / −1 text lines
+0 / −1 text lines
+0 / −1 text lines
+0 / −4 text lines
+0 / −1 text lines
#![expect(clippy::unwrap_used, reason = "integration tests assert on outcomes")]+0 / −3 text lines
+0 / −1 text lines
+66 / −12 text lines
let args = scoped( sequence(&[clippy_prod, clippy_tests, clippy_guests], extra)}/// Production targets carry the full strict gate.fn clippy_prod(extra: &[OsString]) -> ExitCode { clippy_phase(&["--lib", "--bins"], &[], extra)}/// Test targets may assert, panic, and print: outcomes are the point./// Pedantic relaxes too; correctness lints stay on so test quality is/// still policed.fn clippy_tests(extra: &[OsString]) -> ExitCode { clippy_phase( &["--tests"], "-A", "clippy::unwrap_used", "-A", "clippy::expect_used", "-A", "clippy::panic", "-A", "clippy::todo", "-A", "clippy::unimplemented", "-A", "clippy::print_stdout", "-A", "clippy::print_stderr", "-A", "clippy::dbg_macro", "-A", "clippy::pedantic", ); match Command::new("cargo") .env("CLIPPY_CONF_DIR", ".config") .args(&args) .status() { )}/// Guest crates stay strict, cross-checked on their wasm target; the/// crate-level expectations on generated surfaces carry the exceptions.fn clippy_guests(extra: &[OsString]) -> ExitCode { if extra.iter().any(|arg| arg == "-p" || arg == "--package") { return ExitCode::SUCCESS; } clippy_phase( &[ "-p", "smith-plugin-echo", "--target", "wasm32-wasip2", "--lib", ], &[], extra, )}fn clippy_phase(targets: &[&str], lint_args: &[&str], extra: &[OsString]) -> ExitCode { let mut base = vec!["clippy", "--locked"]; base.extend_from_slice(targets); base.push("--all-features"); let args = scoped(&base, extra); let mut command = Command::new("cargo"); command.env("CLIPPY_CONF_DIR", ".config").args(&args); if !lint_args.is_empty() { command.arg("--"); command.args(lint_args); } match command.status() {