Skip to content

Commit ede0b20

Browse files
authored
Bump ruff to 0.2.0 (#16870)
Fix this deprecation warning when running ruff on the repository directly: ``` warning: The top-level linter settings are deprecated in favour of their counterparts in the `lint` section. Please update the following options in `pyproject.toml`: - 'ignore' -> 'lint.ignore' - 'select' -> 'lint.select' - 'unfixable' -> 'lint.unfixable' - 'isort' -> 'lint.isort' ``` Note that you don't see the deprecation warnings if you run ruff via pre-commit (only if you run ruff directly, e.g. via ruff .), since pre-commit [swallows all output from a tool if the tool exits with code 0](https://stackoverflow.com/questions/72895720/pre-commit-hook-does-not-echo-on-terminal/72898524#72898524).
1 parent 7bdd61f commit ede0b20

4 files changed

+18
-17
lines changed

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ repos:
1111
- id: black
1212
exclude: '^(test-data/)'
1313
- repo: https://github.com/astral-sh/ruff-pre-commit
14-
rev: v0.1.15 # must match test-requirements.txt
14+
rev: v0.2.0 # must match test-requirements.txt
1515
hooks:
1616
- id: ruff
1717
args: [--exit-non-zero-on-fix]

pyproject.toml

+15-14
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,20 @@ line-length = 99
3030
target-version = "py38"
3131
fix = true
3232

33+
extend-exclude = [
34+
"@*",
35+
# Sphinx configuration is irrelevant
36+
"docs/source/conf.py",
37+
"mypyc/doc/conf.py",
38+
# tests have more relaxed styling requirements
39+
# fixtures have their own .pyi-specific configuration
40+
"test-data/*",
41+
"mypyc/test-data/*",
42+
# typeshed has its own .pyi-specific configuration
43+
"mypy/typeshed/*",
44+
]
45+
46+
[tool.ruff.lint]
3347
select = [
3448
"E", # pycodestyle (error)
3549
"F", # pyflakes
@@ -66,20 +80,7 @@ unfixable = [
6680
"UP036", # sometimes it's better to just noqa this
6781
]
6882

69-
extend-exclude = [
70-
"@*",
71-
# Sphinx configuration is irrelevant
72-
"docs/source/conf.py",
73-
"mypyc/doc/conf.py",
74-
# tests have more relaxed styling requirements
75-
# fixtures have their own .pyi-specific configuration
76-
"test-data/*",
77-
"mypyc/test-data/*",
78-
# typeshed has its own .pyi-specific configuration
79-
"mypy/typeshed/*",
80-
]
81-
82-
[tool.ruff.isort]
83+
[tool.ruff.lint.isort]
8384
combine-as-imports = true
8485
extra-standard-library = ["typing_extensions"]
8586

test-requirements.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ psutil>=4.0
1414
pytest>=7.4.0
1515
pytest-xdist>=1.34.0
1616
pytest-cov>=2.10.0
17-
ruff==0.1.15 # must match version in .pre-commit-config.yaml
17+
ruff==0.2.0 # must match version in .pre-commit-config.yaml
1818
setuptools>=65.5.1
1919
tomli>=1.1.0 # needed even on py311+ so the self check passes with --python-version 3.8

test-requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ ruamel-yaml==0.17.40
6767
# via pre-commit-hooks
6868
ruamel-yaml-clib==0.2.8
6969
# via ruamel-yaml
70-
ruff==0.1.15
70+
ruff==0.2.0
7171
# via -r test-requirements.in
7272
tomli==2.0.1
7373
# via -r test-requirements.in

0 commit comments

Comments
 (0)