Enable the RUF043 lint in Ruff

This commit is contained in:
Adam Turner
2025-01-02 23:24:38 +00:00
parent 6678e35704
commit 05fc47f120
2 changed files with 6 additions and 2 deletions

View File

@@ -262,6 +262,7 @@ select = [
# "RUF039", # First argument to {call} is not raw string
"RUF040", # Non-string literal used as assert message
"RUF041", # Unnecessary nested `Literal`
"RUF043", # Pattern passed to `match=` contains metacharacters but is neither escaped nor raw
# "RUF048", # `__version__` may contain non-integral-like elements
"RUF055", # Plain string pattern passed to `re` function
# "RUF100", # Unused `noqa` directive

View File

@@ -37,7 +37,7 @@ def test_html_math_renderer_is_duplicated(make_app, app_params):
args, kwargs = app_params
with pytest.raises(
ConfigError,
match='Many math_renderers are registered. But no math_renderer is selected.',
match=r'Many math_renderers are registered\. But no math_renderer is selected\.',
):
make_app(*args, **kwargs)
@@ -74,5 +74,8 @@ def test_html_math_renderer_is_chosen(app):
)
def test_html_math_renderer_is_mismatched(make_app, app_params):
args, kwargs = app_params
with pytest.raises(ConfigError, match="Unknown math_renderer 'imgmath' is given."):
with pytest.raises(
ConfigError,
match=r"Unknown math_renderer 'imgmath' is given\.",
):
make_app(*args, **kwargs)