-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Python Flake8 linter workflow to replace stickler-ci #1786
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 27 commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
f23d95b
adding flake8 linter workflow
reepoi 251a6d9
lint only changed files
reepoi ebf4868
move changed files to env variable
reepoi 93fccc5
remove filename flag
reepoi c58095f
remove trailing dot
reepoi 232f505
rename job
reepoi e064e2c
pass filenames as positional arguments
reepoi cbc1232
pipe filenames to xargs
reepoi 3513b52
change to check pvlib repo
reepoi 0023272
only lint python files
reepoi 5d9d48e
missing parenthesis
reepoi 8c6c36a
skip linting if no Python files edited
reepoi db298fb
try env instead of output
reepoi bed3304
reformatting
reepoi 31cbb3b
create lint issues to try out the new linter
kandersolar 980704b
Revert "create lint issues to try out the new linter"
kandersolar 23700fd
create a lint issue in a file with other lint issues
kandersolar 990d90e
Merge branch 'main' of github.com:pvlib/pvlib-python into stickler-sub
reepoi b90dfdf
use flake8 --diff with flake8 5.0.4
reepoi 8199b8e
Merge branch 'stickler-sub' of github.com:reepoi/pvlib-python into st…
reepoi 79f7e35
call to git fetch
reepoi 0ada7c4
use GITHUB_TOKEN for fetching
reepoi dd00e8a
set repository read permission
reepoi 5920174
try using https link to repo instead of ssh
reepoi fdc65d2
test if GITHUB_TOKEN permissions are not needed
reepoi 043e507
add temporary example of linting annotations
reepoi 1dfbe61
breaking workflow command into more steps
reepoi 302bf35
use base ref variable instead of hard-coding main branch
reepoi 7b6fda9
Merge branch 'main' of github.com:pvlib/pvlib-python into stickler-sub
reepoi c987ee7
update whatsnew and remove lint error example
reepoi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,17 @@ | ||
{ | ||
"problemMatcher": [ | ||
{ | ||
"owner": "flake8-linter-error", | ||
"severity": "error", | ||
"pattern": [ | ||
{ | ||
"regexp": "^([^:]+):(\\d+):(\\d+):\\s+([EWCNF]\\d+\\s+.+)$", | ||
"file": 1, | ||
"line": 2, | ||
"column": 3, | ||
"message": 4 | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains hidden or 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,27 @@ | ||
name: Python Flake8 Linter | ||
on: | ||
pull_request: | ||
jobs: | ||
flake8-linter: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@v3 | ||
- name: Install Python 3.11 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11' | ||
- name: Install Flake8 5.0.4 linter | ||
run: pip install flake8==5.0.4 # use this version for --diff option | ||
- name: Setup Flake8 output matcher for PR annotations | ||
run: echo '::add-matcher::.github/workflows/flake8-linter-matcher.json' | ||
- name: Fetch pvlib main branch | ||
run: | | ||
git remote add upstream https://github.com/pvlib/pvlib-python.git | ||
git fetch upstream main | ||
- name: Run Flake8 linter | ||
run: git diff upstream/main HEAD | flake8 | ||
--exclude pvlib/version.py | ||
--ignore E201,E241,E226,W503,W504 | ||
--max-line-length 79 | ||
--diff |
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.