Open securestep9 opened 4 years ago
Thanks for the suggestion! I'm not quite sure if this is possible using the Github Action's regex parser (or problem matcher, as they call it), as we simply specify which part of flake8 output should be used for which part of the annotations. There is no configuration from which files the output should be used. It is searching through flake8's whole output and not acting on single files.
To keep this annotator universal, I'd suggest restricting flake8 to the files changed within the PR so that only the changed parts will be linted. One way to achieve this is presented in this Medium article, the variables might have to be changed:
DIFF=$(git diff --name-only --diff-filter=b $(git merge-base HEAD $BRANCH))
flake8 $DIFF
when running the GitHub action on a pull request annotations are generated for the whole repo and PR is marked as failed due to errors elsewhere. The action should add annotations on a PR only - on files modified by the PR