Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hatch 1.12.0 ruff defaults invalid for Ruff 0.6.2 (match upstream flake8-trio/flake8-async) #1695

Open
DylanLukes opened this issue Aug 26, 2024 · 1 comment

Comments

@DylanLukes
Copy link

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.

This is due to some rules in Ruff being changed to match flake8-async and flake8-trio, as mentioned here: astral-sh/ruff#10416

Problems

Errors:

These no longer exist:

❯ 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)

@DylanLukes
Copy link
Author

It looks like @DimitriPapadopoulos already has a PR ready at #1588 (which is now for 0.6.2).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@DylanLukes and others