Skip to content

Commit

Permalink
Bump ruff to 0.2.0 (#16870)
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
AlexWaygood authored Feb 5, 2024
1 parent 7bdd61f commit ede0b20
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repos:
- id: black
exclude: '^(test-data/)'
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.15 # must match test-requirements.txt
rev: v0.2.0 # must match test-requirements.txt
hooks:
- id: ruff
args: [--exit-non-zero-on-fix]
Expand Down
29 changes: 15 additions & 14 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,20 @@ line-length = 99
target-version = "py38"
fix = true

extend-exclude = [
"@*",
# Sphinx configuration is irrelevant
"docs/source/conf.py",
"mypyc/doc/conf.py",
# tests have more relaxed styling requirements
# fixtures have their own .pyi-specific configuration
"test-data/*",
"mypyc/test-data/*",
# typeshed has its own .pyi-specific configuration
"mypy/typeshed/*",
]

[tool.ruff.lint]
select = [
"E", # pycodestyle (error)
"F", # pyflakes
Expand Down Expand Up @@ -66,20 +80,7 @@ unfixable = [
"UP036", # sometimes it's better to just noqa this
]

extend-exclude = [
"@*",
# Sphinx configuration is irrelevant
"docs/source/conf.py",
"mypyc/doc/conf.py",
# tests have more relaxed styling requirements
# fixtures have their own .pyi-specific configuration
"test-data/*",
"mypyc/test-data/*",
# typeshed has its own .pyi-specific configuration
"mypy/typeshed/*",
]

[tool.ruff.isort]
[tool.ruff.lint.isort]
combine-as-imports = true
extra-standard-library = ["typing_extensions"]

Expand Down
2 changes: 1 addition & 1 deletion test-requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ psutil>=4.0
pytest>=7.4.0
pytest-xdist>=1.34.0
pytest-cov>=2.10.0
ruff==0.1.15 # must match version in .pre-commit-config.yaml
ruff==0.2.0 # must match version in .pre-commit-config.yaml
setuptools>=65.5.1
tomli>=1.1.0 # needed even on py311+ so the self check passes with --python-version 3.8
2 changes: 1 addition & 1 deletion test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ ruamel-yaml==0.17.40
# via pre-commit-hooks
ruamel-yaml-clib==0.2.8
# via ruamel-yaml
ruff==0.1.15
ruff==0.2.0
# via -r test-requirements.in
tomli==2.0.1
# via -r test-requirements.in
Expand Down

0 comments on commit ede0b20

Please sign in to comment.