Skip to content

Implement flake8-noqa #850

@JonathanPlasse

Description

@JonathanPlasse

flake8-noqa

Error codes

  • NQA001 "#noqa" must have a single space after the hash, e.g. "# noqa"
  • NQA002 "# noqa X000" must have a colon, e.g. "# noqa: X000"
  • NQA003 "# noqa : X000" must not have a space before the colon, e.g. "# noqa: X000"'
  • NQA004 "# noqa:  X000" must have at most one space before the codes, e.g. "# noqa: X000"
  • NQA005 "# noqa: X000, X000" has duplicate codes, remove X000
  • NQA101 "# noqa" has no violations
  • NQA102 "# noqa: X000" has no matching violations
  • NQA103 as RUF100 "# noqa: X000, X001" has unmatched code(s), remove X001
  • NQA104 as PGH004 "# noqa" must have codes, e.g. "# noqa: X000" (enable via noqa-require-code)

Flake8 specific rules

Should we ignore them?

  • NQA011 "#flake8: noqa" must have a single space after the hash, e.g. "# flake8: noqa"
  • NQA012 "# flake8 noqa" must have a colon or equals, e.g. "# flake8: noqa"
  • NQA013 "# flake8 : noqa" must not have a space before the colon, e.g. "# flake8: noqa"

Options

  • noqa-require-code as PGH004 : Require code(s) to be included in # noqa comments
  • noqa-no-require-code : Do not require code(s) in # noqa comments (default setting)
  • noqa-include-name : Include plugin name in messages
  • noqa-no-include-name : Do not include plugin name in messages (default setting)

Metadata

Metadata

Assignees

No one assigned

    Labels

    pluginImplementing a known but unsupported plugin

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions