From b64e03a5fbca2e01fde3e62deaf669ac11a6c09c Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+aa-turner@users.noreply.github.com> Date: Sat, 19 Oct 2024 02:15:59 +0100 Subject: [PATCH] Enable the S701 lint in Ruff --- .ruff.toml | 1 - tests/test_util/test_util_rst.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.ruff.toml b/.ruff.toml index ba4201151..a84b37128 100644 --- a/.ruff.toml +++ b/.ruff.toml @@ -69,7 +69,6 @@ ignore = [ "S404", # `subprocess` module is possibly insecure "S405", # `xml.etree` methods are vulnerable to XML attacks "S603", # `subprocess` call: check for execution of untrusted input - "S701", # Using jinja2 templates with `autoescape=False` is dangerous and can lead to XSS. Ensure `autoescape=True` or use the `select_autoescape` function. "S702", # Mako templates allow HTML and JavaScript rendering by default and are inherently open to XSS attacks # flake8-simplify "SIM102", # Use a single `if` statement instead of nested `if` statements diff --git a/tests/test_util/test_util_rst.py b/tests/test_util/test_util_rst.py index bbe34f54b..d6e83433a 100644 --- a/tests/test_util/test_util_rst.py +++ b/tests/test_util/test_util_rst.py @@ -165,7 +165,7 @@ def test_textwidth(): def test_heading(): - env = Environment() + env = Environment(autoescape=True) env.extend(language=None) assert heading(env, 'Hello') == 'Hello\n====='