Skip to content

Commit

Permalink
[ci] Enable Ruff
Browse files Browse the repository at this point in the history
Also replace yesqa and flake8
  • Loading branch information
tysmith committed Jul 10, 2024
1 parent 9e29c7d commit 9f0c06e
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 10 deletions.
10 changes: 3 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ repos:
rev: 5.13.2
hooks:
- id: isort
- repo: https://github.com/asottile/yesqa
rev: v1.5.0
hooks:
- id: yesqa
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.2
hooks:
Expand All @@ -16,10 +12,10 @@ repos:
rev: 24.4.2
hooks:
- id: black
- repo: https://github.com/pycqa/flake8
rev: 7.0.0
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.1
hooks:
- id: flake8
- id: ruff
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
Expand Down
2 changes: 1 addition & 1 deletion grizzly/replay/replay.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def load_testcases(
tests.append(
TestCase.load(entry, catalog=catalog, entry_point=entry_point)
)
except TestCaseLoadFailure as exc:
except TestCaseLoadFailure as exc: # noqa: PERF203
LOG.warning("Failed to load: '%s' (%s)", entry, exc)
if not tests:
raise TestCaseLoadFailure("Failed to load TestCases")
Expand Down
16 changes: 16 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,20 @@ filterwarnings = [
]
log_level = "DEBUG"

[tool.ruff.lint]
select = [
# pycodestyle
"E",
# Pyflakes
"F",
# Flynt
"FLY",
# Perflint
"PERF",
# Ruff-specific rules
"RUF",
# pycodestyle
"W",
]

[tool.setuptools_scm]
4 changes: 2 additions & 2 deletions sapphire/test_sapphire.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ def test_sapphire_12(client, tmp_path):
# non-alphanumeric chars (valid characters to use on filesystem)
("!@$%^&(_+-=[]),'~`{}", None),
# extended ascii chars
("€d’é-ñÿ", None),
("€d’é-ñÿ", None), # noqa: RUF001
],
)
def test_sapphire_13(client, tmp_path, path, query):
Expand Down Expand Up @@ -667,7 +667,7 @@ def _test_callback():
# non-alphanumeric chars (valid characters to use on filesystem)
"!@$%^&(_+-=[]),'~`{}",
# extended ascii chars
"€d’é-ñÿ",
"€d’é-ñÿ", # noqa: RUF001
],
)
def test_sapphire_25(client, tmp_path, file_name):
Expand Down

0 comments on commit 9f0c06e

Please sign in to comment.