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

Request: allowlist of codes for RUF100 not to autoremove #8153

Closed
jamesbraza opened this issue Oct 24, 2023 · 7 comments
Closed

Request: allowlist of codes for RUF100 not to autoremove #8153

jamesbraza opened this issue Oct 24, 2023 · 7 comments

Comments

@jamesbraza
Copy link
Contributor

Some tools like to use flake8 as a vehicle for config files and ignores:

However, RUF100 in ruff==0.1.1 is removing the # noqa's I add for those tools.

Any chance we can a new config option for ruff that is basically an allowlist override for RUF100?

@jamesbraza
Copy link
Contributor Author

I guess a workaround is, for each noqa that is being removed by RUF100, I can do # noqa: DOC501,RUF100

@charliermarsh
Copy link
Member

I think we have a setting for this: https://docs.astral.sh/ruff/settings/#external. Codes marked as external won’t be removed and flagged by RUF100 (or at least, they shouldn’t be).

Mind giving that a try?

@jamesbraza
Copy link
Contributor Author

Thanks for the response!

I am using pydoclint, which has DOC error codes: https://github.com/jsh9/pydoclint#3-style-violation-codes

external does work, though you have to specify the exact code. It would be nice to be able to use external = ["DOC"], as opposed to external = [..., "DOC201", "DOC301", ..., "DOC501"]

This leads me to a few requests:

Let me know what you think

@zanieb
Copy link
Member

zanieb commented Oct 24, 2023

Fixing those issues in #8171 and #8172

@jamesbraza
Copy link
Contributor Author

Thank you! Interested in hearing what you think of moving external to work using prefixes of rules, not just exact matches

@charliermarsh
Copy link
Member

I think matching prefixes is pretty reasonable.

@jamesbraza
Copy link
Contributor Author

Thank you and cool! I opened #8174 for that.

Will leave this open for @zanieb 's two docs PRs to close this one out ✅ .

@zanieb zanieb closed this as completed Oct 24, 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

3 participants