Enable the entire Q category in Ruff

This commit is contained in:
Adam Turner
2025-01-02 23:36:40 +00:00
parent e459a65775
commit 2aad3a87f4
3 changed files with 11 additions and 15 deletions

View File

@@ -218,11 +218,7 @@ select = [
"PYI",
# Stub files are not used in Sphinx
# flake8-quotes ('Q')
# "Q000", # Double quotes found but single quotes preferred
# "Q001", # Single quote multiline found but double quotes preferred
"Q002", # Single quote docstring found but double quotes preferred
"Q003", # Change outer quotes to avoid escaping inner quotes
"Q004", # Unnecessary escape on inner quote character
"Q",
# flake8-return ('RET')
"RET501", # Do not explicitly `return None` in function if it is the only possible return value
"RET502", # Do not implicitly `return None` in function able to return non-`None` value

View File

@@ -4,13 +4,13 @@ from __future__ import annotations
from typing import Any
PDFLATEX_DEFAULT_FONTPKG = r'''
PDFLATEX_DEFAULT_FONTPKG = r"""
\usepackage{tgtermes}
\usepackage{tgheros}
\renewcommand{\ttdefault}{txtt}
'''
"""
PDFLATEX_DEFAULT_FONTSUBSTITUTION = r'''
PDFLATEX_DEFAULT_FONTSUBSTITUTION = r"""
\expandafter\ifx\csname T@LGR\endcsname\relax
\else
% LGR was declared as font encoding
@@ -32,9 +32,9 @@ PDFLATEX_DEFAULT_FONTSUBSTITUTION = r'''
\substitutefont{X2}{\sfdefault}{cmss}
\substitutefont{X2}{\ttdefault}{cmtt}
\fi
'''
"""
XELATEX_DEFAULT_FONTPKG = r'''
XELATEX_DEFAULT_FONTPKG = r"""
\setmainfont{FreeSerif}[
Extension = .otf,
UprightFont = *,
@@ -56,7 +56,7 @@ XELATEX_DEFAULT_FONTPKG = r'''
BoldFont = *Bold,
BoldItalicFont = *BoldOblique,
]
'''
"""
XELATEX_GREEK_DEFAULT_FONTPKG = (
XELATEX_DEFAULT_FONTPKG
@@ -207,9 +207,9 @@ ADDITIONAL_SETTINGS: dict[Any, dict[str, Any]] = {
}
SHORTHANDOFF = r'''
SHORTHANDOFF = r"""
\ifdefined\shorthandoff
\ifnum\catcode`\=\string=\active\shorthandoff{=}\fi
\ifnum\catcode`\"=\active\shorthandoff{"}\fi
\fi
'''
"""

View File

@@ -1705,7 +1705,7 @@ def test_autodoc_default_options(app):
if (3, 11, 7) <= sys.version_info < (3, 12) or sys.version_info >= (3, 12, 1):
list_of_weak_references = ' list of weak references to the object'
else:
list_of_weak_references = " list of weak references to the object (if defined)" # fmt: skip
list_of_weak_references = ' list of weak references to the object (if defined)' # fmt: skip
# no settings
actual = do_autodoc(app, 'class', 'target.enums.EnumCls')
@@ -1784,7 +1784,7 @@ def test_autodoc_default_options_with_values(app):
if (3, 11, 7) <= sys.version_info < (3, 12) or sys.version_info >= (3, 12, 1):
list_of_weak_references = ' list of weak references to the object'
else:
list_of_weak_references = " list of weak references to the object (if defined)" # fmt: skip
list_of_weak_references = ' list of weak references to the object (if defined)' # fmt: skip
# with :members:
app.config.autodoc_default_options = {'members': 'val1,val2'}