mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2026-10-25 22:50:22 -05:00
Enable the RUF048 lint in Ruff
This commit is contained in:
1 parent
6d3ec7441f
commit
5f6457911d
4 files changed
+3
-6
No files matched your search
+1
-1
@@ -264,7 +264,7 @@ select = [
|
||||
"RUF041", # Unnecessary nested `Literal`
|
||||
"RUF043", # Pattern passed to `match=` contains metacharacters but is neither escaped nor raw
|
||||
"RUF046", # Value being casted is already an integer
|
||||
# "RUF048", # `__version__` may contain non-integral-like elements
|
||||
"RUF048", # `__version__` may contain non-integral-like elements
|
||||
"RUF055", # Plain string pattern passed to `re` function
|
||||
# "RUF100", # Unused `noqa` directive
|
||||
"RUF101", # `{original}` is a redirect to `{target}`
|
||||
|
||||
@@ -31,7 +31,7 @@ if TYPE_CHECKING:
|
||||
from pygments.lexer import Lexer
|
||||
from pygments.style import Style
|
||||
|
||||
if tuple(map(int, pygments.__version__.split('.')))[:2] < (2, 18):
|
||||
if tuple(map(int, pygments.__version__.split('.')[:2])) < (2, 18):
|
||||
from pygments.formatter import Formatter # NoQA: F811
|
||||
|
||||
Formatter.__class_getitem__ = classmethod(lambda cls, name: cls) # type: ignore[attr-defined]
|
||||
|
||||
@@ -12,7 +12,7 @@ from pygments.token import Name, Text
|
||||
|
||||
from sphinx.highlighting import PygmentsBridge
|
||||
|
||||
if tuple(map(int, pygments.__version__.split('.')))[:2] < (2, 18):
|
||||
if tuple(map(int, pygments.__version__.split('.')[:2]))[:2] < (2, 18):
|
||||
from pygments.formatter import Formatter
|
||||
|
||||
Formatter.__class_getitem__ = classmethod(lambda cls, name: cls) # type: ignore[attr-defined]
|
||||
|
||||
@@ -7,15 +7,12 @@ import os
|
||||
import time
|
||||
from pathlib import Path
|
||||
|
||||
import babel
|
||||
import pytest
|
||||
from babel.messages.mofile import read_mo
|
||||
|
||||
from sphinx.errors import SphinxError
|
||||
from sphinx.util import i18n
|
||||
|
||||
BABEL_VERSION = tuple(map(int, babel.__version__.split('.')))
|
||||
|
||||
|
||||
def test_catalog_info_for_file_and_path():
|
||||
cat = i18n.CatalogInfo('path', 'domain', 'utf-8')
|
||||
|
||||
Reference in new issue
Block a user