Skip to content

Q000, Q001, Q002 can't be ignored in Ruff 0.3.5 #10724

@hinohi

Description

@hinohi

In Ruff 0.3.5, if specifying to ignore one or two of the Q000, Q001, Q002 rules, they are not ignored.
However, if specifying to ignore all three of those rules, then it works as expected.

Reproduction code:

'''
bad docsting
'''
a = 'single'
b = '''
bad multi line
'''

Running:

ruff check . --isolated --select Q --ignore Q000
ruff check . --isolated --select Q --ignore Q001
ruff check . --isolated --select Q --ignore Q002
ruff check . --isolated --select Q --ignore Q000,Q001
ruff check . --isolated --select Q --ignore Q000,Q002
ruff check . --isolated --select Q --ignore Q001,Q002

Output is:

a.py:1:1: Q002 [*] Single quote docstring found but double quotes preferred
a.py:4:5: Q000 Single quotes found but double quotes preferred
a.py:5:5: Q001 [*] Single quote multiline found but double quotes preferred
Found 3 errors.
[*] 2 fixable with the `--fix` option.

If specifying to ignore all three of those rules, then it works as expected:

$ ruff check . --isolated --select Q --ignore Q000,Q001,Q002
All checks passed!
  • In 0.3.4, it correctly shows All checks passed!.
  • I've tested this with Python versions 3.12.0 and 3.9.18, and the behavior is the same on both.
  • I've observed this on both macOS 13.6 and Ubuntu 22.04.
  • The issue persists whether configuring via the pyproject.toml file or command line arguments.

Please let me know if you need any clarification or have additional details to provide.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions