summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2024-01-07 16:25:10 +0000
committerDaniel Silverstone <dsilvers@digital-scurf.org>2024-01-07 16:25:10 +0000
commita1329775a73759c4cebe3c12026f0d081080a78f (patch)
tree256f29996296320b7b01729224787a58a09a3fb9
parent4bb560e9e06abe7276a6e8db396334b0798a5409 (diff)
downloadsubplot-a1329775a73759c4cebe3c12026f0d081080a78f.tar.gz
check: When --strict, do not pass --merciful
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
-rwxr-xr-xcheck36
1 files 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":