Skip to content

Update ruff utils with a used method in recipes - #383

Open
FrancescoPezzella wants to merge 1 commit into
mainfrom
ruff-utils
Open

FrancescoPezzella wants to merge 1 commit into
mainfrom
ruff-utils

Conversation

@FrancescoPezzella

Copy link
Copy Markdown
Collaborator

No description provided.

@FrancescoPezzella FrancescoPezzella self-assigned this Nov 5, 2026
@FrancescoPezzella FrancescoPezzella added the enhancement New feature or request label Nov 5, 2026

@pjljvandelaar pjljvandelaar left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

A design question.
Should we apply ruff for just the changes we need - to ensure minimum changes - or for some predefined set of changes?

I wonder whether all recipes will always need all (currently three) ruff options
and whether code owners will complain about changes made by ruff that are not related to our original / desired transformation.

Of course for safety and security, I think it is good that the user cannot provide arguments when ruff is called.

@FrancescoPezzella

Copy link
Copy Markdown
Collaborator Author

A design question. Should we apply ruff for just the changes we need - to ensure minimum changes - or for some predefined set of changes?

I wonder whether all recipes will always need all (currently three) ruff options and whether code owners will complain about changes made by ruff that are not related to our original / desired transformation.

Of course for safety and security, I think it is good that the user cannot provide arguments when ruff is called.

The rules I added in ruff.utils are the bare minimum from Ruff and nothing else. I think if there is a Ruff rule that we find universally useful to almost always use, then we can add it there.

One thing Renaissance.Py does not do currently, is any sort of formatting. Also I think it would be the opposite, I think "code owners" complain if the code is left with random white spaces, weird import order, etc after applying a recipe.

… parameter CLI's ruff pass no longer runs UP049, whose fix can leave a same-named TypeVar behind (astral-sh/ruff#21004).

@pjljvandelaar pjljvandelaar left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The change is nice.

I am very curious how the different code owners respond.
From my previous experience, code owners were not happy with some of changes made by the formatter (ruff in this case) whenever a formatter was NOT normally used.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants