Skip to content

Update Ruff to >=0.13 and simplify configs#185

Open
Avasam wants to merge 1 commit intojaraco:mainfrom
Avasam:update-ruff-and-simplify-configs
Open

Update Ruff to >=0.13 and simplify configs#185
Avasam wants to merge 1 commit intojaraco:mainfrom
Avasam:update-ruff-and-simplify-configs

Conversation

@Avasam
Copy link
Contributor

@Avasam Avasam commented Oct 31, 2025

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-rules section to only the codes for which you'd enable the entire group in parallel. Because the base E and F rules in default select are already non-conflicting and we use extend-select to start from said base.

Comment on lines +54 to +55
# Deprecated rules must now be selected by exact rule code
"ruff >= 0.13; sys_platform != 'cygwin'",
Copy link
Contributor Author

@Avasam Avasam Oct 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Contributor Author

@Avasam Avasam Oct 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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", # pyupgrade

@Avasam Avasam force-pushed the update-ruff-and-simplify-configs branch from c5b6780 to 16bc2dc Compare October 31, 2025 18:08
@Avasam Avasam force-pushed the update-ruff-and-simplify-configs branch from 16bc2dc to ef1b5fd Compare March 13, 2026 16:15
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

Successfully merging this pull request may close these issues.

1 participant