ruff/crates
Bohdan b45fd61ec5
[pyupgrade] Replace str, Enum with StrEnum (UP042) (#10713)
## Summary

Add new rule `pyupgrade - UP042` (I picked next available number).
Closes https://github.com/astral-sh/ruff/discussions/3867
Closes https://github.com/astral-sh/ruff/issues/9569

It should warn + provide a fix `class A(str, Enum)` -> `class
A(StrEnum)` for py311+.

## Test Plan

Added UP042.py test.

## Notes

I did not find a way to call `remove_argument` 2 times consecutively, so
the automatic fixing works only for classes that inherit exactly `str,
Enum` (regardless of the order).

I also plan to extend this rule to support IntEnum in next PR.
2024-04-06 01:56:28 +00:00
..
ruff Bump version to v0.3.5 (#10717) 2024-04-01 13:15:32 -04:00
ruff_benchmark Run doctests as part of CI pipeline (#9939) 2024-02-12 10:18:58 +01:00
ruff_cache Make all dependencies workspace dependencies (#9333) 2024-01-02 13:41:59 +00:00
ruff_dev Docs: Link inline settings when not part of options section (#10499) 2024-03-21 16:33:58 +00:00
ruff_diagnostics Delete unused Violation::explanation method (#10600) 2024-03-26 12:35:27 +01:00
ruff_formatter Remove unused dependencies (#10475) 2024-03-19 17:33:47 +01:00
ruff_index Run doctests as part of CI pipeline (#9939) 2024-02-12 10:18:58 +01:00
ruff_linter [pyupgrade] Replace str, Enum with StrEnum (UP042) (#10713) 2024-04-06 01:56:28 +00:00
ruff_macros Remove long Iterator::chain sequence in RuleCodePrefix::iter (#10452) 2024-03-18 16:51:20 +01:00
ruff_notebook Remove unused dependencies (#10475) 2024-03-19 17:33:47 +01:00
ruff_python_ast Implement as_str & Display for all operator enums (#10691) 2024-04-02 10:34:36 +00:00
ruff_python_codegen Track casing of r-string prefixes in the tokenizer and AST (#10314) 2024-03-18 17:18:04 +00:00
ruff_python_formatter Update Rust to v1.77 (#10510) 2024-03-21 12:10:33 -04:00
ruff_python_index Fix Indexer fails to identify continuation preceded by newline #10351 (#10354) 2024-03-12 00:35:41 -04:00
ruff_python_literal Remove unused dependencies (#10475) 2024-03-19 17:33:47 +01:00
ruff_python_parser Remove an unused dependency (#10747) 2024-04-03 09:57:19 +01:00
ruff_python_resolver chore(deps): update rust crate insta to v1.38.0 (#10701) 2024-04-01 15:44:30 +00:00
ruff_python_semantic Add semantic model flag when inside f-string replacement field (#10766) 2024-04-04 09:08:48 +05:30
ruff_python_stdlib [pylint] Include builtin warnings in useless-exception-statement (PLW0133) (#10394) 2024-03-13 15:26:11 -04:00
ruff_python_trivia Remove unused dependencies (#10475) 2024-03-19 17:33:47 +01:00
ruff_server Remove debug print when resolving client settings in ruff server (#10799) 2024-04-06 00:13:25 +00:00
ruff_shrinking Bump version to v0.3.5 (#10717) 2024-04-01 13:15:32 -04:00
ruff_source_file Remove unused dependencies (#10475) 2024-03-19 17:33:47 +01:00
ruff_text_size Range formatting: Fix invalid syntax after parenthesizing expression (#9751) 2024-02-02 17:56:25 +01:00
ruff_wasm Run doctests as part of CI pipeline (#9939) 2024-02-12 10:18:58 +01:00
ruff_workspace [flake8-boolean-trap] Add setting for user defined allowed boolean trap (#10531) 2024-03-30 00:26:12 +00:00