One of the stated benefits of a persistent ruff_defaults.toml generated by hatch fmt --check --sync is that it enables consistency with external tools. However, the defaults generated break when one uses a new version of ruff for IDE integration via LSP.
❯ ruff check src
ruff failed
Cause: Failed to parse redacted/ruff_defaults.toml
Cause: TOML parse error at line 7, column 1
|
7 | [lint]
| ^^^^^^
Unknown rule selector: `ASYNC101`
And likewise for ASYNC102.
Warnings:
warning: `PLR1701` has been remapped to `SIM101`.
warning: `TRIO100` has been remapped to `ASYNC100`.
warning: `TRIO105` has been remapped to `ASYNC105`.
warning: `TRIO109` has been remapped to `ASYNC109`.
warning: `TRIO110` has been remapped to `ASYNC110`.
warning: `TRIO115` has been remapped to `ASYNC115`.
warning: Rule `E999` is deprecated and will be removed in a future release. Syntax errors will always be shown regardless of whether this rule is selected or not.
warning: Rule `UP027` is deprecated and will be removed in a future release.
Proposed Fix
Update the version of ruff used in Hatch to 0.6.x, and make the changes shown above to the default configuration.
Related
Previous: #1084
See also: #1461 (tangentially related)
One of the stated benefits of a persistent
ruff_defaults.toml
generated byhatch fmt --check --sync
is that it enables consistency with external tools. However, the defaults generated break when one uses a new version ofruff
for IDE integration via LSP.This is due to some rules in Ruff being changed to match
flake8-async
andflake8-trio
, as mentioned here: https://github.com/astral-sh/ruff/pull/10416Problems
Errors:
These no longer exist:
And likewise for
ASYNC102
.Warnings:
Proposed Fix
Update the version of
ruff
used in Hatch to 0.6.x, and make the changes shown above to the default configuration.Related
Previous: #1084 See also: #1461 (tangentially related)