Update Ruff and fix its errors

This commit is contained in:
Joakim Hellsén 2026-07-21 04:12:13 +02:00
commit 1424978854
Signed by: Joakim Hellsén
SSH key fingerprint: SHA256:/9h/CsExpFp+PRhsfA0xznFx2CGfTT5R/kpuFfUgEQk
39 changed files with 183 additions and 175 deletions

View file

@ -1,4 +1,4 @@
import xml.etree.ElementTree as ET # noqa: S405
import xml.etree.ElementTree as ET # ruff:ignore[suspicious-xml-etree-import]
from typing import TYPE_CHECKING
from django.urls import reverse
@ -9,7 +9,7 @@ if TYPE_CHECKING:
def _extract_locs(xml_bytes: bytes) -> list[str]:
root = ET.fromstring(xml_bytes) # noqa: S314
root = ET.fromstring(xml_bytes) # ruff:ignore[suspicious-xml-element-tree-usage]
ns = {"s": "http://www.sitemaps.org/schemas/sitemap/0.9"}
return [el.text for el in root.findall(".//s:loc", ns) if el.text]