From 25a6ddfd4d6c2508cc69baaf647fffeba6d704a7 Mon Sep 17 00:00:00 2001 From: Spencer Bryngelson Date: Thu, 18 Jan 2024 20:35:13 -0500 Subject: [PATCH] satisfy linter --- toolchain/mfc/args.py | 2 +- toolchain/mfc/count.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/toolchain/mfc/args.py b/toolchain/mfc/args.py index 18636dbc0..0d6170c5d 100644 --- a/toolchain/mfc/args.py +++ b/toolchain/mfc/args.py @@ -136,7 +136,7 @@ def add_common_arguments(p, mask = None): # Add default arguments of other subparsers for name, parser in [("run", run), ("test", test), ("build", build), - ("clean", clean), ("bench", bench), ("count", count), + ("clean", clean), ("bench", bench), ("count", count), ("count_diff", count_diff)]: if args["command"] == name: continue diff --git a/toolchain/mfc/count.py b/toolchain/mfc/count.py index 8d582dd5a..83ca3ac4d 100644 --- a/toolchain/mfc/count.py +++ b/toolchain/mfc/count.py @@ -52,6 +52,7 @@ def count(): cons.print() cons.unindent() +# pylint: disable=too-many-locals def count_diff(): target_str_list = format_list_to_string(ARG('targets'), 'magenta') cons.print(f"[bold]Counting lines of code in {target_str_list}[/bold] (excluding whitespace lines)") @@ -59,7 +60,8 @@ def count_diff(): total = 0 MFC_COMPAREDIR=os.getenv('MFC_PR') - if MFC_COMPAREDIR is None: raise MFCException("MFC_PR is not in your enviroment.") + if MFC_COMPAREDIR is None: + raise MFCException("MFC_PR is not in your environment.") # MFC_COMPAREDIR="/Users/spencer/Downloads/MFC-shbfork" for codedir in ['common'] + ARG("targets"): @@ -76,7 +78,7 @@ def count_diff(): files_root = [os.path.basename(dirfiles_root[i][0]) for i in range(len(dirfiles_root))] for filepath, n in dirfiles_pr: - for filepath_root, q in dirfiles_root: + for filepath_root, _ in dirfiles_root: if os.path.basename(dirfiles_pr[ii][0]) == os.path.basename(filepath_root): diff_count = n - dirfiles_root[ii][1] mycolor = "red" if diff_count > 0 else "green"