summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcheck14
1 files changed, 11 insertions, 3 deletions
diff --git a/check b/check
index 2573a9e..5dc60ed 100755
--- a/check
+++ b/check
@@ -165,13 +165,18 @@ def check_shell(r):
r.runcmd_maybe(["shellcheck"] + sh)
-def check_rust(r):
+def check_rust(r, strict=False):
"""Run all checks for Rust code"""
r.title("checking Rust code")
r.runcmd(["cargo", "build", "--all-targets"])
if r.got_cargo("clippy"):
- r.runcmd(["cargo", "clippy"])
+ if strict:
+ r.runcmd(["cargo", "clippy", "--all-targets", "--", "-D", "warnings"])
+ else:
+ r.runcmd(["cargo", "clippy", "--all-targets"])
+ elif strict:
+ sys.exit("Strict Rust checks specified, but clippy was not found")
r.runcmd(["cargo", "test"])
r.runcmd(["cargo", "fmt"])
@@ -250,6 +255,9 @@ def parse_args():
p.add_argument(
"-p", dest="progress", action="store_true", help="print some progress output"
)
+ p.add_argument(
+ "--strict", action="store_true", help="don't allow compiler warnings"
+ )
all_whats = ["python", "shell", "rust", "subplots", "subplotlib"]
p.add_argument(
@@ -270,7 +278,7 @@ def main():
elif what == "shell":
check_shell(r)
elif what == "rust":
- check_rust(r)
+ check_rust(r, strict=args.strict)
elif what == "subplots":
check_subplots(r)
elif what == "subplotlib":