Skip to content

Commit dfa1db2

Browse files
committed
Update ruff to 0.2.0 and fix deprications
1 parent 811beab commit dfa1db2

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ repos:
2222
- id: black
2323

2424
- repo: https://github.com/astral-sh/ruff-pre-commit
25-
rev: v0.1.9
25+
rev: v0.2.0
2626
hooks:
2727
- id: ruff
2828
args: [--fix, --exit-non-zero-on-fix]

pyproject.toml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,20 +138,22 @@ distlib = "https://bitbucket.org/pypa/distlib/raw/master/LICENSE.txt"
138138
webencodings = "https://github.com/SimonSapin/python-webencodings/raw/master/LICENSE"
139139

140140
[tool.ruff]
141+
target-version = "py37"
142+
line-length = 88
141143
extend-exclude = [
142144
"_vendor",
143145
"./build",
144146
".scratch",
145147
"data",
146148
]
149+
150+
[tool.ruff.lint]
147151
ignore = [
148152
"B019",
149153
"B020",
150154
"B904", # Ruff enables opinionated warnings by default
151155
"B905", # Ruff enables opinionated warnings by default
152156
]
153-
target-version = "py37"
154-
line-length = 88
155157
select = [
156158
"ASYNC",
157159
"B",
@@ -170,22 +172,22 @@ select = [
170172
"UP032",
171173
]
172174

173-
[tool.ruff.isort]
175+
[tool.ruff.lint.isort]
174176
# We need to explicitly make pip "first party" as it's imported by code in
175177
# the docs and tests directories.
176178
known-first-party = ["pip"]
177179
known-third-party = ["pip._vendor"]
178180

179-
[tool.ruff.mccabe]
181+
[tool.ruff.lint.mccabe]
180182
max-complexity = 33 # default is 10
181183

182-
[tool.ruff.per-file-ignores]
184+
[tool.ruff.lint.per-file-ignores]
183185
"noxfile.py" = ["G"]
184186
"src/pip/_internal/*" = ["PERF203"]
185187
"tests/*" = ["B011"]
186188
"tests/unit/test_finder.py" = ["C414"]
187189

188-
[tool.ruff.pylint]
190+
[tool.ruff.lint.pylint]
189191
max-args = 15 # default is 5
190192
max-branches = 28 # default is 12
191193
max-returns = 13 # default is 6

0 commit comments

Comments
 (0)