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

Consider adding «ALL_CONFLICTING_LINTER_FORMATTER_RULES» code #8968

Closed
sam-hosseini opened this issue Dec 2, 2023 · 1 comment
Closed

Comments

@sam-hosseini
Copy link

Hello!

Thanks again for this 😊

I wanted to ask if you'd consider adding a code for all the rules specified in Conflicting lint rules here.

The reason I'm asking is because I'm assuming many folks (here/here/here), myself included, use ruff to take advantage of the 700+ built-in rules. This motivates me to set ALL in my select setting and selectively disable what I don't want.

However, when adding the formatter into the mix, we have to manually ignore all the rules that conflict with the linter (14 as of now) and make sure to update this in the future in upgrades.

Now, my config looks like this:

[tool.ruff.lint]
select = ["ALL"]
ignore = [
    ###############################################################
    # https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
    ###############################################################
    "COM812",
    "COM819",
    "D206",
    "D300",
    "E111",
    "E114",
    "E117",
    "ISC001",
    "ISC002",
    "Q000",
    "Q001",
    "Q002",
    "Q003",
    "W191",
]

I think it'd be much better and concise if I could just do this:

[tool.ruff.lint]
select = ["ALL"]
ignore = ["ALL_CONFLICTING_LINTER_FORMATTER_RULES"]

And this «ALL_CONFLICTING_LINTER_FORMATTER_RULES» (or a better name) would be the list of 14 conflicting rules that is maintained by the library. What do you think? 😊

@MichaReiser
Copy link
Member

MichaReiser commented Dec 4, 2023

Thanks for this suggestion. We're currently considering the following options

  • Category with all conflicting rules as you're proposing
  • A new option to disable the warnings
  • Changing the semantics of all / recategorising the rules: Have fewer categories like correctness, style, suspicious, format (includes all conflicting rules) that allows easier opt-in/opt-out rather than listing plenty of rules or rule-groups.

Our preferred option for now is to re-categorise the rules because we don't recommend using all ALL rules because we believe that many rules in ALL are too opinionated in and don't necessary help catch issues / improve productivity. But we understand that many use it because Ruff lacks a better default set.

These options are not strictly exclusive. E.g. some users want to use the conflicting lint rules together with the formatter because they haven't run into any problems in practice.

I'll close this issue and you can see our progress in #8175

@MichaReiser MichaReiser closed this as not planned Won't fix, can't repro, duplicate, stale Dec 4, 2023
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

2 participants