diff --git a/pyproject.toml b/pyproject.toml index 4c235da57..d0353e2e6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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"] diff --git a/sphinx/domains/rst.py b/sphinx/domains/rst.py index 0072f7acb..480aba525 100644 --- a/sphinx/domains/rst.py +++ b/sphinx/domains/rst.py @@ -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, diff --git a/tests/test_directives_no_typesetting.py b/tests/test_directives_no_typesetting.py index f4acc80ea..fd101fb4c 100644 --- a/tests/test_directives_no_typesetting.py +++ b/tests/test_directives_no_typesetting.py @@ -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') diff --git a/tests/test_ext_doctest.py b/tests/test_ext_doctest.py index 9602f483d..c83e582ae 100644 --- a/tests/test_ext_doctest.py +++ b/tests/test_ext_doctest.py @@ -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