Skip to content

Commit

Permalink
add default for pylintrc
Browse files Browse the repository at this point in the history
  • Loading branch information
mnschmit committed May 9, 2023
1 parent 1e7a865 commit 323661d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion linting_orchestrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

LINTER_TO_CMD = {
"flake8": ["flake8", "--extend-exclude=dist,build"],
"pylint": ["pylint", "--output-format=json", "--rcfile=.pylintrc"],
"pylint": ["pylint", "--output-format=json"],
}
LINTER_TO_FORMAT = {"flake8": "flake8", "pylint": "pylint-json"}

Expand All @@ -28,6 +28,12 @@


def main(args: argparse.Namespace) -> None:
if os.path.exists(".pylintrc"):
LINTER_TO_CMD["pylint"].append("--rcfile=.pylintrc")
else:
path = os.path.join(os.environ["GITHUB_ACTION_PATH"], ".pylintrc")
LINTER_TO_CMD["pylint"].append(f"--rcfile={path}")

if not args.python_files:
print("No lintable python files. Exiting.")
sys.exit(0)
Expand Down

0 comments on commit 323661d

Please sign in to comment.