50 violations: list[tuple[int, str]] = []
51 with open(path,
"r", encoding=
"utf-8", errors=
"replace")
as f:
52 for i, raw
in enumerate(f, start=1):
54 if UNDERSCORE_BETWEEN_DIGITS.search(scannable):
55 violations.append((i, raw.rstrip(
"\n")))
60 here = os.path.dirname(os.path.abspath(__file__))
61 daq_root = os.path.dirname(here)
62 config_dir = os.path.join(daq_root,
"config")
66 glob.glob(os.path.join(config_dir,
"*.toml"))
67 + glob.glob(os.path.join(config_dir,
"profiles",
"*.toml"))
70 print(f
"[check_toml] no TOML files found in {config_dir}", flush=
True)
76 rel = os.path.relpath(path, daq_root)
77 print(f
"{rel}:{line_no}: underscore digit-separator in number → {text.strip()}",
83 f
"\n[check_toml] {total} underscore-separated number(s) found. The C++ config "
84 "parsers (std::stoul) truncate these — write plain integers (5006, not 5_006).",
88 print(f
"[check_toml] OK — {len(files)} config TOML file(s) have no underscore-separated numbers.",