Skip to content

Commit 80cb6f4

Browse files
committed
Switch to ruff for linting
1 parent 5e8e88e commit 80cb6f4

File tree

3 files changed

+35
-10
lines changed

3 files changed

+35
-10
lines changed

.pre-commit-config.yaml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,11 @@ repos:
2121
hooks:
2222
- id: black
2323

24-
- repo: https://github.com/PyCQA/flake8
25-
rev: 6.0.0
24+
- repo: https://github.com/astral-sh/ruff-pre-commit
25+
# Ruff version.
26+
rev: v0.0.270
2627
hooks:
27-
- id: flake8
28-
additional_dependencies: [
29-
'flake8-bugbear',
30-
'flake8-logging-format',
31-
'flake8-implicit-str-concat',
32-
]
33-
exclude: tests/data
28+
- id: ruff
3429

3530
- repo: https://github.com/PyCQA/isort
3631
rev: 5.12.0

noxfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ def pinned_requirements(path: Path) -> Iterator[Tuple[str, str]]:
219219
new_version = old_version
220220
for inner_name, inner_version in pinned_requirements(vendor_txt):
221221
if inner_name == name:
222-
# this is a dedicated assignment, to make flake8 happy
222+
# this is a dedicated assignment, to make lint happy
223223
new_version = inner_version
224224
break
225225
else:

pyproject.toml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,33 @@ setuptools = "pkg_resources"
7171
CacheControl = "https://raw.githubusercontent.com/ionrock/cachecontrol/v0.12.6/LICENSE.txt"
7272
distlib = "https://bitbucket.org/pypa/distlib/raw/master/LICENSE.txt"
7373
webencodings = "https://github.com/SimonSapin/python-webencodings/raw/master/LICENSE"
74+
75+
[tool.ruff]
76+
exclude = [
77+
"./build",
78+
".nox",
79+
".tox",
80+
".scratch",
81+
"_vendor",
82+
"data",
83+
]
84+
ignore = [
85+
"B019",
86+
"B020",
87+
"B904", # Ruff enables opinionated warnings by default
88+
"B905", # Ruff enables opinionated warnings by default
89+
"G202",
90+
]
91+
line-length = 88
92+
select = [
93+
"B",
94+
"E",
95+
"F",
96+
"W",
97+
"G",
98+
"ISC",
99+
]
100+
101+
[tool.ruff.per-file-ignores]
102+
"noxfile.py" = ["G"]
103+
"tests/*" = ["B011"]

0 commit comments

Comments
 (0)