Files
JasonHoku-ComfyUI-Ultimate-…/tests/test_resources_lint.py
T
Jason HokuandClaude Fable 5.1 b45fde0410 fix(dashboard): remove leftover merge marker that dropped the first pairwise CSS rule
CSS error recovery merged the stray ======= line with the following selector,
so .cmp-setting-row was lost in every browser. A lint test guards resources/.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-11-04 00:58:30 -08:00

20 lines
755 B
Python

"""Lint for the dashboard resources: leftover merge markers silently break CSS/JS."""
import os
import re
_RES = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "resources")
_MARKER = re.compile(r"^(<<<<<<<|=======|>>>>>>>)( |$)")
def test_no_merge_markers_in_resources():
bad = []
for name in sorted(os.listdir(_RES)):
path = os.path.join(_RES, name)
if not os.path.isfile(path):
continue
with open(path, encoding="utf-8", errors="replace") as f:
for n, line in enumerate(f, 1):
if _MARKER.match(line.rstrip("\r\n")):
bad.append(f"{name}:{n}: {line.strip()}")
assert not bad, "merge markers left in resources: " + "; ".join(bad)