Update Ruff pre-commit hook to v0.3.4#16264
Conversation
Ruff rule UP032 can automatically convert `str.format()` calls to f-strings. Before v0.3.2 Ruff avoided making changes if the naive conversion produced lines that exceeded the line length limit, but now it is more aggressive. The `pre-commit` hook is updated manually to prevent Ruff from producing overlong lines.
|
Thank you for your contribution to Astropy! 🌌 This checklist is meant to remind the package maintainers who will review this pull request of some common things to look for.
|
|
Thanks! I see that you milestoned this to v7.0.0, which means we cannot merge until v6.1.x is branched out. |
taldcroft
left a comment
There was a problem hiding this comment.
Good for io.ascii, time, table.
Wouldn't this also mean that all bot PRs will be noise until this one is merged ? |
mhvk
left a comment
There was a problem hiding this comment.
units and utils are fine (not much of an improvement, but also not really worse). Not a rule I feel we should necessarily enforce
astrofrog
left a comment
There was a problem hiding this comment.
Looks good to me and will merge to include in v6.1.0 to reduce backport issues.
Agreed; should perhaps discuss how to deal with cases like |
Description
The Ruff rule UP032 can automatically convert
str.format()calls to f-strings. Before v0.3.2 Ruff avoided making changes if the naive conversion produced lines that exceeded the line length limit (88 characters for us), but now it is more aggressive. Updating thepre-commithook manually prevents Ruff from producing overlong lines like it tried to do in #16253.