From 198cbbd173f1782e0353238dd2db300ec1a0827f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20Kl=C3=B6ffel?= <145490354+christophkloeffel@users.noreply.github.com> Date: Mon, 17 Jun 2024 11:54:48 +0200 Subject: [PATCH] adds argument --out to online_report tool (#40) --- lobster/tools/core/online_report.py | 8 ++++++-- lobster/tools/trlc/trlc.py | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lobster/tools/core/online_report.py b/lobster/tools/core/online_report.py index 0b6afdd0..a5591399 100755 --- a/lobster/tools/core/online_report.py +++ b/lobster/tools/core/online_report.py @@ -60,6 +60,9 @@ def main(): ap.add_argument("--repo-root", help="override git repository root", default=None) + ap.add_argument("--out", + help="output file, by default overwrite input", + default=None) options = ap.parse_args() if not os.path.isfile(options.lobster_report): @@ -122,6 +125,7 @@ def main(): rel_path_from_root = os.path.relpath(item.location.filename, repo_root) + # pylint: disable=possibly-used-before-assignment actual_repo = gh_root actual_sha = options.commit actual_path = rel_path_from_root @@ -140,9 +144,9 @@ def main(): line = item.location.line) item.location = loc - report.write_report(options.lobster_report) + report.write_report(options.out if options.out else options.lobster_report) print("LOBSTER report %s changed to use online references" % - options.lobster_report) + options.out if options.out else options.lobster_report) if __name__ == "__main__": diff --git a/lobster/tools/trlc/trlc.py b/lobster/tools/trlc/trlc.py index ef9905c2..801a411c 100644 --- a/lobster/tools/trlc/trlc.py +++ b/lobster/tools/trlc/trlc.py @@ -410,6 +410,7 @@ def main(): ok = False if ok: stab = sm.process() + # pylint: disable=possibly-used-before-assignment if not ok or stab is None: print("lobster-trlc: aborting due to earlier error") return 1