-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Upgrade to Ruff 0.2.0 with formatting * Move ruff config to ruff.toml * Move coverage config to .coveragerc * Specify the optional testing/linting dependencies * Update GHA runner versions
- Loading branch information
Showing
8 changed files
with
110 additions
and
89 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,38 @@ | ||
[run] | ||
branch = true | ||
parallel = true | ||
concurrency = multiprocessing, thread | ||
source = wagtailmedia | ||
|
||
omit = **/migrations/*,tests/*,src/wagtailmedia/admin.py,src/wagtailmedia/deprecation.py | ||
|
||
[paths] | ||
source = src,.tox/py*/**/site-packages | ||
|
||
[report] | ||
show_missing = true | ||
ignore_errors = true | ||
skip_empty = true | ||
skip_covered = true | ||
|
||
exclude_also = | ||
# Have to re-enable the standard pragma | ||
pragma: no cover | ||
|
||
# Don't complain about missing debug-only code: | ||
def __repr__ | ||
if self.debug | ||
if settings.DEBUG | ||
|
||
# Don't complain if tests don't hit defensive assertion code: | ||
raise AssertionError | ||
raise NotImplementedError | ||
|
||
# Don't complain if non-runnable code isn't run: | ||
if 0: | ||
if __name__ == .__main__.: | ||
|
||
# Nor complain about type checking | ||
"if TYPE_CHECKING:", | ||
class .*\bProtocol\): | ||
@(abc\.)?abstractmethod |
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,22 @@ | ||
name: Ruff | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- 'stable/**' | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
ruff: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- run: python -Im pip install --user ruff | ||
|
||
- name: Run ruff | ||
working-directory: ./src | ||
run: ruff --output-format=github wagtailmedia |
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
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,28 @@ | ||
[lint] | ||
extend-select = [ | ||
"B", # flake8-bugbear | ||
"C4", # flake8-comprehensions | ||
"E", # pycodestyle errors | ||
"F", # pyflakes | ||
"I", # isort | ||
"S", # flake8-bandit | ||
"W", # pycodestyle warnings | ||
"UP", # pyupgrade | ||
] | ||
|
||
extend-ignore = [ | ||
"E501", # no line length errors | ||
] | ||
|
||
fixable = ["C4", "E", "F", "I", "UP"] | ||
|
||
[lint.per-file-ignores] | ||
"tests/**.py" = ["S105", "S106"] | ||
|
||
[lint.isort] | ||
known-first-party = ["src"] | ||
lines-between-types = 1 | ||
lines-after-imports = 2 | ||
|
||
[format] | ||
docstring-code-format = true |
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