diff --git a/admin/scripts/check_html_safety.py b/admin/scripts/check_html_safety.py index 94f5e3f..57023b3 100644 --- a/admin/scripts/check_html_safety.py +++ b/admin/scripts/check_html_safety.py @@ -45,7 +45,7 @@ A literal remote URL appears in a markup-bearing string, or an `href=`/`src=` attribute is completed by an interpolation. A dynamic destination cannot be shown to be report-relative by reading the source, so it fails unless it comes from - `safe_local_link()`. + `safe_local_path()` or `safe_local_link()`. `unguarded-html-columns` A module declares `html_columns` but never references an escaper. This catches the @@ -125,16 +125,9 @@ # Pre-existing violations. Delete an entry when its violation is fixed; a stale entry # fails the run. See the module docstring before adding one. -BASELINE = { - # media_to_html() assigns `source` four times before emitting it -- the raw match, - # a relative path, a copied path, then safe_local_path(). A name is treated as safe - # only when *every* assignment to it is, because this check does not order - # assignments. The function is in fact correct: the last write is safe_local_path() - # and nothing reads `source` before it. Rewriting it to bind the escaped value to - # its own name would clear this honestly. - ('scripts/ilapfuncs.py', 'remote-destination', 'media_to_html'), - ('scripts/ilapfuncs.py', 'unescaped-interpolation', 'media_to_html'), -} +# +# Empty: every finding this core had is now fixed rather than carried. +BASELINE = set() # Reviewed exceptions expected to stay. Every entry needs a comment saying why. ALLOWLIST = set() @@ -276,6 +269,12 @@ def _resolve(node, assignments, names, seen): if isinstance(node, ast.JoinedStr): return all(_resolve(v.value, assignments, names, seen) for v in node.values if isinstance(v, ast.FormattedValue)) + # `agg = agg + f'