Skip to content

Treat all RUF10x noqa codes as used#23237

Closed
amyreese wants to merge 1 commit intomainfrom
amy/unused-ruf10x
Closed

Treat all RUF10x noqa codes as used#23237
amyreese wants to merge 1 commit intomainfrom
amy/unused-ruf10x

Conversation

@amyreese
Copy link
Member

These codes are generated while processing noqa, so will never be seen
as "used" by this logic. Just go ahead and treat them as used and trust
that they're there for a reason.

Issue #23191, fixes #21877

These codes are generated while processing noqa, so will never be seen
as "used" by this logic. Just go ahead and treat them as used and trust
that they're there for a reason.

Issue #23191, fixes #21877
@amyreese amyreese requested a review from ntBre February 11, 2026 19:47
@amyreese amyreese added the suppression Related to supression of violations e.g. noqa label Feb 11, 2026
@astral-sh-bot
Copy link

astral-sh-bot bot commented Feb 11, 2026

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@ntBre
Copy link
Contributor

ntBre commented Feb 12, 2026

I'm not sure that we want to blanket mark these as used. Since #23191 mostly boils down to external being the better solution than a string of noqa comments, I wonder if we should just add a sub-diagnostic to RUF100 and maybe RUF102 suggesting to use it? I guess it would make more sense on RUF102 actually. The option is listed in the docs for both rules but without any description, so it might help to document its use a bit more clearly too.

@ntBre
Copy link
Contributor

ntBre commented Feb 20, 2026

Should we close this and #23236 (and #23191) after #23268, or do we need both? I can't remember what we discussed before 😄 I think I'm pretty happy with pointing people toward the external configuration option, but I'm certainly open to other improvements.

@amyreese
Copy link
Member Author

amyreese commented Feb 20, 2026

yeah, I think with the docs we can just close this and the ones you linked. We should also update RUF100 to drop the overlap with RUF102 (or at least if RUF102 is enabled)

@ntBre
Copy link
Contributor

ntBre commented Feb 20, 2026

Makes sense to me! Do you want to open a follow-up issue for that? I also think we should expand RUF102 to handle file-level comments so we can drop the warning and close #23267 (comment).

@amyreese amyreese closed this Feb 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

suppression Related to supression of violations e.g. noqa

Projects

None yet

Development

Successfully merging this pull request may close these issues.

noqa for unused suppression reported as unused noqa

2 participants