Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug OR potentially documentation needed #49

Open
lwasser opened this issue Oct 30, 2024 · 3 comments
Open

Bug OR potentially documentation needed #49

lwasser opened this issue Oct 30, 2024 · 3 comments

Comments

@lwasser
Copy link
Member

lwasser commented Oct 30, 2024

I'm trying to better understand the hatch environments that we have setup.
When i run the format command i see a conflict with some arguments that i think are passed to ruff

format = "ruff format {args}"

➜ hatch run style:format
Warning: The following rules may cause conflicts when used with the formatter: COM812, ISC001. To avoid unexpected behavior, we recommend disabling these rules, either by removing them from the select or extend-select configuration, or adding them to the ignore configuration.
3 files left unchanged

Should we add these to the default ruff ignore items so the warning doesn't get raised?

@Midnighter
Copy link
Contributor

Both of those are sensible rules to have, in my opinion.

Please take a look at this comment astral-sh/ruff#8741 (comment). To summarize, ruff format does not take into account configured rules. Only ruff check does. Here the formatter warns us that it may produce output that conflicts with those rules.

So in a workflow, ruff format should always be followed by ruff check --fix. I do not know how to disable the warning, but I vote for keeping the rules.

@sneakers-the-rat
Copy link
Contributor

this is not a comment that is making a recommendation for or against, i just want to say yoloing ruff enable=["ALL"] is such a bold move

@Midnighter
Copy link
Contributor

My thought is, disable what you don't like ;)

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

No branches or pull requests

3 participants