From a1329775a73759c4cebe3c12026f0d081080a78f Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Sun, 7 Jan 2024 16:25:10 +0000 Subject: check: When --strict, do not pass --merciful Signed-off-by: Daniel Silverstone --- check | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/check b/check index 12196a5..06a4e2d 100755 --- a/check +++ b/check @@ -177,21 +177,23 @@ class Runcmd: ] ) - def get_templates(self, filename): + def get_templates(self, filename, strict): + args = [ + "run", + "--quiet", + "--package=subplot", + "--bin=subplot", + "--", + f"--resources={os.path.abspath('share')}", + "metadata", + "-o", + "json", + ] + if not strict: + args += ["--merciful"] + args += [filename] metadata = self.cargo( - [ - "run", - "--quiet", - "--package=subplot", - "--bin=subplot", - "--", - f"--resources={os.path.abspath('share')}", - "metadata", - "-o", - "json", - "--merciful", - filename, - ], + args, stdout=PIPE, stderr=PIPE, ).stdout.decode("UTF-8") @@ -274,7 +276,7 @@ def check_rust(r, strict=False, sloppy=False): r.runcmd(["cargo", "fmt", "--", "--check"]) -def check_subplots(r): +def check_subplots(r, strict=False): """Run all Subplots and generate documents for them""" output = os.path.abspath("test-outputs") os.makedirs(output, exist_ok=True) @@ -295,7 +297,7 @@ def check_subplots(r): doc_template = None - for template in r.get_templates(subplot0): + for template in r.get_templates(subplot0, strict): if doc_template is None: doc_template = template if template == "python": @@ -442,7 +444,7 @@ def main(): elif what == "rust": check_rust(r, strict=args.strict, sloppy=args.sloppy) elif what == "subplots": - check_subplots(r) + check_subplots(r, strict=args.strict) elif what == "tooling": check_tooling(r) elif what == "doc": -- cgit v1.2.1