Skip to content

Commit 433a889

Browse files
flake8, bugbear, pyupgrade → ruff
1 parent c7d9c55 commit 433a889

File tree

3 files changed

+29
-56
lines changed

3 files changed

+29
-56
lines changed

.flake8

Lines changed: 0 additions & 41 deletions
This file was deleted.

.pre-commit-config.yaml

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,33 +6,22 @@ repos:
66
hooks:
77
- id: absolufy-imports
88
name: absolufy-imports
9+
- repo: https://github.com/astral-sh/ruff-pre-commit
10+
rev: v0.14.5
11+
hooks:
12+
- id: ruff-check
913
- repo: https://github.com/pycqa/isort
1014
rev: 5.13.2
1115
hooks:
1216
- id: isort
1317
language_version: python3
14-
- repo: https://github.com/asottile/pyupgrade
15-
rev: v3.17.0
16-
hooks:
17-
- id: pyupgrade
18-
args:
19-
- --py39-plus
2018
- repo: https://github.com/psf/black
2119
rev: 24.8.0
2220
hooks:
2321
- id: black
2422
language_version: python3
2523
args:
2624
- --target-version=py39
27-
- repo: https://github.com/pycqa/flake8
28-
rev: 7.1.1
29-
hooks:
30-
- id: flake8
31-
language_version: python3
32-
additional_dependencies:
33-
# NOTE: autoupdate does not pick up flake8-bugbear since it is a transitive
34-
# dependency. Make sure to update flake8-bugbear manually on a regular basis.
35-
- flake8-bugbear==24.8.19
3625
- repo: https://github.com/codespell-project/codespell
3726
rev: v2.3.0
3827
hooks:

pyproject.toml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,31 @@ distributed = [
7777
"py.typed",
7878
]
7979

80+
[tool.ruff]
81+
line-length = 120
82+
83+
[tool.ruff.lint]
84+
extend-select = [
85+
"B",
86+
"UP",
87+
]
88+
ignore = [
89+
"B011", # Do not `assert False`, raise `AssertionError()`
90+
"B018", # Found useless expression
91+
"B028", # FIXME: No explicit `stacklevel` keyword argument found
92+
"B904", # Within an `except` clause, raise exceptions with `raise ... from err` or `raise ... from None` to distinguish them from errors in exception handling
93+
"B905", # `zip()` without an explicit `strict=` parameter
94+
"F841", # Local variable `futures` is assigned to but never used
95+
"E402", # Module level import not at top of file
96+
"E714", # Test for object identity should be `is not`
97+
"E721", # Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
98+
"E741", # Ambiguous variable name: `l`
99+
]
100+
101+
[tool.ruff.lint.extend-per-file-ignores]
102+
"**__init__.py" = ["F401", "F811"]
103+
"distributed/shuffle/tests/test_shuffle.py" = ["F601"]
104+
80105
[tool.isort]
81106
sections = ["FUTURE", "STDLIB", "THIRDPARTY", "DISTRIBUTED", "FIRSTPARTY", "LOCALFOLDER"]
82107
profile = "black"

0 commit comments

Comments
 (0)