MCPcopy
hub / github.com/saltstack/salt / _load_allowlist

Function _load_allowlist

tools/audit_doc_links.py:68–82  ·  view source on GitHub ↗

Return the configured allowlist patterns. The default tuple above is always included. If ``path`` is given, any non-comment, non-blank line is appended to the result.

(path: pathlib.Path | None)

Source from the content-addressed store, hash-verified

66
67
68def _load_allowlist(path: pathlib.Path | None) -> list[str]:
69 """Return the configured allowlist patterns.
70
71 The default tuple above is always included. If ``path`` is given,
72 any non-comment, non-blank line is appended to the result.
73 """
74 patterns = list(DEFAULT_ALLOWLIST)
75 if path is None:
76 return patterns
77 for raw in path.read_text(encoding="utf-8").splitlines():
78 line = raw.strip()
79 if not line or line.startswith("#"):
80 continue
81 patterns.append(line)
82 return patterns
83
84
85def _strip_catchall_ignores(conf_py: pathlib.Path, strip: list[str]) -> str:

Callers 1

run_auditFunction · 0.85

Calls 3

listFunction · 0.50
read_textMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected