-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Upgrade ruff and use it for formatting as well * Lint * Move coverage config to .coveragerc * Add a Ruff GH action for inline annotations
- Loading branch information
Showing
18 changed files
with
110 additions
and
108 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 | ||
concurrency = multiprocessing, thread | ||
parallel = True | ||
source_pkgs = grapple | ||
omit = **/migrations/*,docs/*,tests/* | ||
|
||
[paths] | ||
source = grapple,.tox/py*/**/site-packages | ||
|
||
[report] | ||
show_missing = True | ||
ignore_errors = True | ||
skip_covered = True | ||
skip_empty = true | ||
|
||
# Regexes for lines to exclude from consideration | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
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 | ||
run: ruff --output-format=github grapple |
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 |
---|---|---|
|
@@ -4,5 +4,3 @@ class IllegalDeprecation(Exception): | |
This is invalid - a deprecated entity must be nullable. | ||
""" | ||
|
||
pass |
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
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 |
---|---|---|
@@ -1,33 +1,40 @@ | ||
target-version = "py38" | ||
extend-exclude = ["build"] | ||
|
||
exclude = ["dist","build","venv",".venv",".tox",".git"] | ||
|
||
select = [ | ||
[lint] | ||
extend-select = [ | ||
"B", # flake8-bugbear | ||
"BLE", # flake8-blind-except | ||
"C4", # flake8-comprehensions | ||
"DJ", # flake8-django | ||
"E", # pycodestyle errors | ||
"F", # pyflakes | ||
"FBT", # flake8-boolean-trap | ||
"I", # isort | ||
"PIE", # flake8-pie | ||
"PGH", # pygrep-hooks | ||
"RUF100", # unused noqa | ||
"S", # flake8-bandit | ||
"SIM", # flake8-simplify | ||
"T20", # flake8-print | ||
"UP", # pyupgrade | ||
"W", # pycodestyle warnings | ||
"YTT", # flake8-2020 | ||
] | ||
|
||
fixable = ["C4", "E", "F", "I", "UP"] | ||
extend-ignore = [ | ||
"E501", # Line too long | ||
"B028", # function-call-in-default-argument | ||
] | ||
|
||
# E501: Line too long | ||
ignore = ["E501","B028"] | ||
fixable = ["C4", "E", "F", "I", "UP"] | ||
|
||
[per-file-ignores] | ||
[lint.per-file-ignores] | ||
"tests/**.py" = ["DJ008"] | ||
|
||
[isort] | ||
[lint.isort] | ||
known-first-party = ["grapple"] | ||
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
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
Oops, something went wrong.