Skip to content

Ability to add a reason along with --add-noqa #10070

@ashrub-holvi

Description

@ashrub-holvi

Hi!

Ruff can automatically add noqa directives, but they don't have any info about how they were added:

  # noqa: S308

and it may be difficult to distinguish intentionally/manually added noqa and those automatically added.

I think, main use case is migration to ruff for existing codebase without fixing everything at once, but it should be clear that those noqa added automatically and should be handled at some point, something like that:

  # noqa: S308 FIXME when you are here

Downside of it - adding longer comment will produce more formatting changes, so, perhaps

  # noqa: S308 auto

or even ruff may have some argument for provide the text of comment.

Metadata

Metadata

Assignees

Labels

cliRelated to the command-line interfacehelp wantedContributions especially welcome

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions