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

Both D400 and D415 error messages with --select ALL #8469

Closed
DimitriPapadopoulos opened this issue Nov 3, 2023 · 2 comments
Closed

Both D400 and D415 error messages with --select ALL #8469

DimitriPapadopoulos opened this issue Nov 3, 2023 · 2 comments
Labels
needs-decision Awaiting a decision from a maintainer

Comments

@DimitriPapadopoulos
Copy link
Contributor

DimitriPapadopoulos commented Nov 3, 2023

When selecting ALL rules or just D400 and D415, D415 should take precedence over D400 (or the reverse?) so that ruff prints a single error message instead of two messages:

  • """Documentation"""
  • $ ruff --isolated --select D400,D415 /path/to/file.py
    /path/to/file.py:1:1: D400 First line should end with a period
    /path/to/file.py:1:1: D415 First line should end with a period, question mark, or exclamation point
    Found 2 errors.
    No fixes available (2 hidden fixes can be enabled with the `--unsafe-fixes` option).
    $ 
    
  • $ ruff --version
    ruff 0.1.3
    $ 
    
@charliermarsh
Copy link
Member

I agree this is non-ideal, but making rules dependent on whether other rules are enabled causes problems and breaks some assumptions within Ruff. For example, if you have # noqa: D415 on that line, but then run ruff check --select D400, D400 would now be triggered instead of D415 (since D415 isn't active), and the violation would be raised. If you added a # noqa: D400, D415, then the # noqa: D400 portion would appear unused and get flagged as an unused # noqa.

I think I'd prefer to solve this via rule recategorization. Like, this seems more appropriate as a setting on the rule than as two separate rules.

@charliermarsh charliermarsh added the needs-decision Awaiting a decision from a maintainer label Nov 3, 2023
@zanieb
Copy link
Member

zanieb commented Nov 3, 2023

Let's group this into #1774

@zanieb zanieb closed this as not planned Won't fix, can't repro, duplicate, stale Nov 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-decision Awaiting a decision from a maintainer
Projects
None yet
Development

No branches or pull requests

3 participants