Upgrade Ruff to 0.11.12
- Run
scripts/update_ruff.pyto update. - Handle this error manually:
ruff failed Cause: Selection of deprecated rules is not allowed when preview is enabled. Remove selection of: - S320 - UP038 - Handle these warnings manually:
warning: `TCH001` has been remapped to `TC001`. warning: `TCH002` has been remapped to `TC002`. warning: `TCH003` has been remapped to `TC003`. warning: `TCH004` has been remapped to `TC004`. warning: `TCH005` has been remapped to `TC005`. warning: `TCH010` has been remapped to `TC010`. warning: `TRY302` has been remapped to `TRY203`.
The linter target should be py38 but hatch fmt --check clearly uses a more recent target, hence the CI errors.
Any clue how the target Python version is chosen?
I have extracted some commits to #2063 to simplify this PR.
I can remove the last commit: https://github.com/pypa/hatch/pull/1890/commits/8d75a8e046c07600186ab6b7c32c326bb650f604.
CI will fail until quoting is fixed: https://github.com/pypa/hatch/blob/136c763a2a348eab0ab214c2c0f1895dc721c9c9/ruff.toml#L8
Do you know how large of a diff it would be to move to double quotes now? The only reason I'm worried about mass changes is because someone is working on the workspaces branch and I don't want to introduce many conflicts until their work is merged.
I am okay with moving to double quotes, I can handle the rebase locally for double quotes changes even with a large diff. A lot of the work so far has been mostly around fixing the unit tests and getting to a working build state then getting to the remaining implementation details.
Okay then, please switch everything to double quotes in this PR!
Done.
- Modify
ruff.toml. - Run
ruff format.
Changes are a little bit massive, not easy to review. You might want to rerun locally to make sure my last commit does what it pretends it does...