mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2026-11-03 12:48:34 -06:00
Enable the RUF001 lint in Ruff
This commit is contained in:
1 parent
477401c4e4
commit
fd8ce84582
3 files changed
+6
-6
No files matched your search
+2
-2
@@ -70,7 +70,6 @@ ignore = [
|
||||
"UP031", # Use format specifiers instead of percent format
|
||||
"UP032", # Use f-string instead of `format` call
|
||||
# Ruff-specific rules ('RUF')
|
||||
"RUF001", # String contains ambiguous {}. Did you mean {}?
|
||||
"RUF012", # Mutable class attributes should be annotated with `typing.ClassVar`
|
||||
"RUF021", # Parenthesize `a and b` expressions when chaining `and` and `or` together, to make the precedence clear
|
||||
"RUF022", # `__all__` is not sorted
|
||||
@@ -321,7 +320,7 @@ logger-objects = [
|
||||
"sphinx/ext/autodoc/importer.py" = ["D402"]
|
||||
"sphinx/util/requests.py" = ["D402"]
|
||||
|
||||
"sphinx/search/*" = ["E501"]
|
||||
"sphinx/search/*" = ["E501", "RUF001"]
|
||||
|
||||
# whitelist ``token`` in date format parsing
|
||||
"sphinx/util/i18n.py" = ["S105"]
|
||||
@@ -334,6 +333,7 @@ logger-objects = [
|
||||
"ANN", # tests don't need annotations
|
||||
"D402",
|
||||
"PLC1901", # whitelist comparisons to the empty string ('')
|
||||
"RUF001", # ambiguous unicode character
|
||||
"S301", # allow use of ``pickle``
|
||||
"S403", # allow use of ``pickle``
|
||||
"T201", # whitelist ``print`` for tests
|
||||
|
||||
@@ -29,8 +29,8 @@ tex_replacements = [
|
||||
# map some special Unicode characters to similar ASCII ones
|
||||
# (even for Unicode LaTeX as may not be supported by OpenType font)
|
||||
('⎽', r'\_'),
|
||||
('ℯ', r'e'),
|
||||
('ⅈ', r'i'),
|
||||
('ℯ', r'e'), # U+212F # NoQA: RUF001
|
||||
('ⅈ', r'i'), # U+2148 # NoQA: RUF001
|
||||
# Greek alphabet not escaped: pdflatex handles it via textalpha and inputenc
|
||||
# OHM SIGN U+2126 is handled by LaTeX textcomp package
|
||||
]
|
||||
@@ -63,7 +63,7 @@ unicode_tex_replacements = [
|
||||
('±', r'\(\pm\)'),
|
||||
('→', r'\(\rightarrow\)'),
|
||||
('‣', r'\(\rightarrow\)'),
|
||||
('–', r'\textendash{}'),
|
||||
('\N{EN DASH}', r'\textendash{}'),
|
||||
# superscript
|
||||
('⁰', r'\(\sp{\text{0}}\)'),
|
||||
('¹', r'\(\sp{\text{1}}\)'),
|
||||
|
||||
@@ -1503,7 +1503,7 @@ class TexinfoTranslator(SphinxTranslator):
|
||||
self.first_param = 0
|
||||
text = self.escape(node.astext())
|
||||
# replace no-break spaces with normal ones
|
||||
text = text.replace(' ', '@w{ }')
|
||||
text = text.replace('\N{NO-BREAK SPACE}', '@w{ }')
|
||||
self.body.append(text)
|
||||
raise nodes.SkipNode
|
||||
|
||||
|
||||
Reference in new issue
Block a user