Skip to content

Commit 0ab649f

Browse files
committed
refactor changes to linter cmd
1 parent 323661d commit 0ab649f

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

linting_orchestrator.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,22 @@
2727
]
2828

2929

30-
def main(args: argparse.Namespace) -> None:
30+
def linter_cmd_defaults(python_files: list[str]):
3131
if os.path.exists(".pylintrc"):
3232
LINTER_TO_CMD["pylint"].append("--rcfile=.pylintrc")
3333
else:
3434
path = os.path.join(os.environ["GITHUB_ACTION_PATH"], ".pylintrc")
3535
LINTER_TO_CMD["pylint"].append(f"--rcfile={path}")
3636

37-
if not args.python_files:
37+
if not python_files:
3838
print("No lintable python files. Exiting.")
3939
sys.exit(0)
4040
else:
41-
LINTER_TO_CMD[args.linter].extend(args.python_files)
41+
LINTER_TO_CMD[args.linter].extend(python_files)
42+
43+
44+
def main(args: argparse.Namespace) -> None:
45+
linter_cmd_defaults(args.python_files)
4246

4347
linting_process = subprocess.run(
4448
LINTER_TO_CMD[args.linter], capture_output=True, check=False

0 commit comments

Comments
 (0)