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

M001 is not working #352

Closed
adriangb opened this issue Oct 7, 2022 · 6 comments
Closed

M001 is not working #352

adriangb opened this issue Oct 7, 2022 · 6 comments

Comments

@adriangb
Copy link
Contributor

adriangb commented Oct 7, 2022

With ruff v0.0.59 given a file like:

def foo() -> None:
    a = 1  # noqa: F401
    print(a)

Running:

ruff --extend-select M001 test.py

There are no errors

@charliermarsh
Copy link
Member

Interestingly I actually get:

∴ ruff --select M001 foo.py
Found 1 error(s).
foo.py:2:10: M001 Unused `noqa` directive for: F401
1 potentially fixable with the --fix option.

@charliermarsh
Copy link
Member

Does ruff --show-settings test.py have anything interesting?

@adriangb
Copy link
Contributor Author

adriangb commented Oct 7, 2022

Oh duh user error, I had a config file floating around...

@adriangb adriangb closed this as completed Oct 7, 2022
@charliermarsh
Copy link
Member

Out of curiosity: what was the config file doing? Did it have an explicit ignore on M001? Something else?

@adriangb
Copy link
Contributor Author

adriangb commented Oct 7, 2022

Did it have an explicit ignore on M001?

Yes 🤦🏻 , I don't even remember why I put it in there. Embarrassing.

@charliermarsh
Copy link
Member

Not embarrassing at all! It's bad that it was confusing for you as the user. If you explicitly --select something that's ignored by the config, we should warn you.

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