Update Ruff to >=0.13 and simplify configs#185
Conversation
| # Deprecated rules must now be selected by exact rule code | ||
| "ruff >= 0.13; sys_platform != 'cygwin'", |
There was a problem hiding this comment.
Alternatively, this can be set directly in ruff.toml with required-version. The UX is not great if updating from before version 0.14.11 as it used to fails at runtime w/o telling you to re-sync your dependencies (astral-sh/ruff#19922)
| "UP043", # unnecessary-default-type-args | ||
|
|
||
| # Code modernization (strings, annotations, conditions, ...) | ||
| "UP", # pyupgrade |
There was a problem hiding this comment.
Alternatively:
"C901", # complex-structure
"I", # isort
"PERF401", # manual-list-comprehension
+ "UP", # pyupgrade (Code modernization for strings, annotations, conditions, ...)
# Ensure modern type annotation syntax and best practices
# Not including those covered by type-checkers or exclusive to Python 3.11+
"FA", # flake8-future-annotations
"F404", # late-future-import
"PYI", # flake8-pyi
-
- # Code modernization (strings, annotations, conditions, ...)
- "UP", # pyupgradeThere was a problem hiding this comment.
I have a slight preference for this alternative, as it's more compact.
c5b6780 to
16bc2dc
Compare
16bc2dc to
ef1b5fd
Compare
jaraco
left a comment
There was a problem hiding this comment.
Oops. I see I reviewed this but failed to send it :(
In general, looks good to me.
| "Q003", | ||
| "COM812", | ||
| "COM819", | ||
|
|
There was a problem hiding this comment.
I'd like to keep this space for separation.
| "UP043", # unnecessary-default-type-args | ||
|
|
||
| # Code modernization (strings, annotations, conditions, ...) | ||
| "UP", # pyupgrade |
There was a problem hiding this comment.
I have a slight preference for this alternative, as it's more compact.
Same changes as for pypa/setuptools#4886
Do test on some repos with lots of string formatting, f-string (UP032) is not necessarily a rule you may want to enforce all the time.
Reduced the
conflicting-lint-rulessection to only the codes for which you'd enable the entire group in parallel. Because the baseEandFrules in defaultselectare already non-conflicting and we useextend-selectto start from said base.