Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a GitHub Action that will run flake8 on submitted PRs (#651)
* Added new Python linter (flake8). It will run as a GitHub Action on every pull request. It will annotate every error it finds. * Update flake8_python_linter.yml * Update flake8_python_linter.yml * Update flake8_python_linter.yml * Update flake8_python_linter.yml Added more errors/warnings to ignore. * Updated requirements.txt by adding flake8
- Loading branch information
1 parent
e6d28d3
commit d9ca9b3
Showing
2 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# This workflow runs flake8 with reviewdog. The documentation can be found below: | ||
# https://github.com/marketplace/actions/run-flake8-with-reviewdog | ||
# Flake8 is a Python linter that analyzes code and checks for programming and stylistic errors | ||
name: Flake8 Linter | ||
|
||
# This workflow acts only on pull requests | ||
on: pull_request | ||
|
||
jobs: | ||
|
||
flake8-lint: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out source repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python environment | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: "3.8" | ||
|
||
- name: Flake8 Lint | ||
uses: reviewdog/action-flake8@v3 | ||
with: | ||
# For more flake 8 arguments, visit the link below: | ||
# https://flake8.pycqa.org/en/latest/user/options.html | ||
# Currently, flake8 ignores the following; | ||
# W291: Trailing whitespace | ||
# W292: No newline at end of file | ||
# W293: Blank line contains whitespace | ||
# E202: Whitespace before ')' | ||
# E203: Whitespace before ':' | ||
# E221: Multiple spaces before operator | ||
# E241: Multiple spaces after ',' | ||
# E251: Unexpected spaces around keyword / parameter equals | ||
# E272: Multiple spaces before keyword | ||
flake8_args: "--ignore=W291,W292,W293,E202,E203,E221,E241,E251,E272 --max-line-length 120" | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,4 @@ python-dateutil | |
nibabel | ||
numpy | ||
scipy | ||
flake8 |