-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added py-checks.yml workflow for PR python syntax checking * Added .ruff.toml for PR python error/warning classes to check * py-checks.yml: checks only run on python files changed
- Loading branch information
Showing
2 changed files
with
30 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,25 @@ | ||
name: Python Checks | ||
on: | ||
pull_request: | ||
paths: | ||
- '**.py' | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- '**.py' | ||
jobs: | ||
ruff-check: | ||
name: Check syntax | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Get py files changed | ||
id: get-files | ||
# In this step, we get the names of all the *.py files changed before the push/pull_request event | ||
# and replaces the newlines with spaces so github actions understands the input in the next step | ||
run: echo "files=$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }} -- '*.py' | tr '\n' ' ')" >> $GITHUB_OUTPUT | ||
- uses: chartboost/ruff-action@v1 | ||
with: | ||
src: "${{ steps.get-files.outputs.files }}" | ||
args: "check --format github --preview --config .ruff.toml" |
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,5 @@ | ||
select = ["E","F"] | ||
ignore = ["E221","E241","E272","E731","F405","F821"] | ||
line-length = 80 | ||
|
||
# "E129", "F999" aren't supported |