Skip to content

Commit

Permalink
satisfy linter
Browse files Browse the repository at this point in the history
  • Loading branch information
sbryngelson committed Jan 19, 2024
1 parent 146af39 commit 25a6ddf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion toolchain/mfc/args.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions toolchain/mfc/count.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,16 @@ 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)")
cons.indent()

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"):
Expand All @@ -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"
Expand Down

0 comments on commit 25a6ddf

Please sign in to comment.