Enable E241 (Multiple spaces after comma)

This commit is contained in:
Adam Turner 2023-08-15 18:16:27 +01:00
parent f1ee0b2951
commit e3f0342932
4 changed files with 13 additions and 9 deletions

View File

@ -310,6 +310,7 @@ select = [
"E227", # Missing whitespace around bitwise or shift operator
"E228", # Missing whitespace around modulo operator
"E231", # Missing whitespace after '{token}'
"E241", # Multiple spaces after comma
]
[tool.ruff.per-file-ignores]
@ -318,6 +319,9 @@ select = [
# allow print() in the tutorial
"doc/development/tutorials/examples/recipe.py" = ["T201"]
# from .flake8
"sphinx/*" = ["E241"]
# whitelist ``print`` for stdout messages
"sphinx/cmd/build.py" = ["T201"]
"sphinx/cmd/make_mode.py" = ["T201"]

View File

@ -215,9 +215,9 @@ class ReSTDomain(Domain):
label = 'reStructuredText'
object_types = {
'directive': ObjType(_('directive'), 'dir'),
'directive': ObjType(_('directive'), 'dir'),
'directive:option': ObjType(_('directive-option'), 'dir'),
'role': ObjType(_('role'), 'role'),
'role': ObjType(_('role'), 'role'),
}
directives = {
'directive': ReSTDirective,

View File

@ -19,7 +19,7 @@ DOMAINS = [
]
@pytest.mark.parametrize(('directive', 'no_index', 'no_index_entry', 'sig_f', 'sig_g', 'index_g'), DOMAINS)
@pytest.mark.parametrize(('directive', 'no_index', 'no_index_entry', 'sig_f', 'sig_g', 'index_g'), DOMAINS)
def test_object_description_no_typesetting(app, directive, no_index, no_index_entry, sig_f, sig_g, index_g):
text = (f'.. {directive}:: {sig_f}\n'
f' :no-typesetting:\n')

View File

@ -45,12 +45,12 @@ def test_is_allowed_version():
assert is_allowed_version('<3.4', '3.3') is True
assert is_allowed_version('<3.4', '3.3') is True
assert is_allowed_version('<3.2', '3.3') is False
assert is_allowed_version('<=3.4', '3.3') is True
assert is_allowed_version('<=3.2', '3.3') is False
assert is_allowed_version('==3.3', '3.3') is True
assert is_allowed_version('==3.4', '3.3') is False
assert is_allowed_version('>=3.2', '3.3') is True
assert is_allowed_version('>=3.4', '3.3') is False
assert is_allowed_version('<=3.4', '3.3') is True
assert is_allowed_version('<=3.2', '3.3') is False
assert is_allowed_version('==3.3', '3.3') is True
assert is_allowed_version('==3.4', '3.3') is False
assert is_allowed_version('>=3.2', '3.3') is True
assert is_allowed_version('>=3.4', '3.3') is False
assert is_allowed_version('>3.2', '3.3') is True
assert is_allowed_version('>3.4', '3.3') is False
assert is_allowed_version('~=3.4', '3.4.5') is True