From 334643f3b7b5a3e9c1b7f24b7e153663ee221d44 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Mon, 24 Apr 2023 18:07:57 +0300 Subject: tests: don't check formatting or clippy in MSRV CI job stable and MSRV versions of rustfmt make different formatting change. Thus, one will fail. We prefer the stable version. Sponsored-by: author --- check | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'check') diff --git a/check b/check index e928bab..7e2e9b5 100755 --- a/check +++ b/check @@ -231,13 +231,13 @@ def check_shell(r): r.runcmd_maybe(["shellcheck"] + sh) -def check_rust(r, strict=False): +def check_rust(r, strict=False, sloppy=False): """Run all checks for Rust code""" r.title("checking Rust code") r.runcmd(["cargo", "build", "--workspace", "--all-targets"]) - if r.got_cargo("clippy"): + if r.got_cargo("clippy") and not sloppy: argv = [ "cargo", "clippy", @@ -254,7 +254,8 @@ def check_rust(r, strict=False): sys.exit("Strict Rust checks specified, but clippy was not found") r.runcmd(["cargo", "test", "--workspace"]) - r.runcmd(["cargo", "fmt", "--", "--check"]) + if not sloppy: + r.runcmd(["cargo", "fmt", "--", "--check"]) def check_subplots(r): @@ -360,6 +361,9 @@ def parse_args(): p.add_argument( "--strict", action="store_true", help="don't allow compiler warnings" ) + p.add_argument( + "--sloppy", action="store_true", help="don't check formatting or with clippy" + ) all_whats = ["tooling", "python", "shell", "rust", "subplots"] p.add_argument( @@ -391,7 +395,7 @@ def main(): elif what == "shell": check_shell(r) elif what == "rust": - check_rust(r, strict=args.strict) + check_rust(r, strict=args.strict, sloppy=args.sloppy) elif what == "subplots": check_subplots(r) elif what == "tooling": -- cgit v1.2.1