-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reorganize github workflows: one check on push+pr, one check+format t…
…hen commit, only on push on master
- Loading branch information
Félix Piédallu
committed
Mar 14, 2024
1 parent
751ff67
commit e03e960
Showing
4 changed files
with
61 additions
and
44 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
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,32 @@ | ||
name: Python formatting with Black and Ruff | ||
|
||
on: | ||
push: | ||
branches: [master] | ||
|
||
jobs: | ||
format: | ||
name: Formatting with Black and Ruff | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Check files using the black formatter | ||
uses: psf/black@stable | ||
id: black | ||
with: | ||
options: "." | ||
continue-on-error: true | ||
|
||
- uses: actions/setup-python@v2 | ||
- name: Install Ruff | ||
run: pip install ruff | ||
|
||
- name: Ruff check and fix | ||
run: | | ||
ruff check . | ||
ruff check --fix . | ||
- uses: stefanzweifel/git-auto-commit-action@v4 | ||
with: | ||
commit_message: 'Python formatting fixes from Black and Ruff' |
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,21 @@ | ||
[tool.black] | ||
line-length = 120 | ||
|
||
[tool.ruff] | ||
line-length = 120 | ||
|
||
[tool.ruff.lint] | ||
select = [ | ||
"F", # pyflakes | ||
"E", # pycodestyle | ||
"W", # pycodestyle | ||
"I", # isort | ||
"N", # pep8-naming | ||
"B", # flake8-ubgbear | ||
"ANN", # flake8-annotations | ||
"Q", # flake8-quotes | ||
"PTH", # flake8-use-pathlib | ||
"UP", # pyupgrade, | ||
] | ||
|
||
[tool.mypy] |