diff options
| author | Claude <noreply@anthropic.com> | 2026-05-13 20:35:38 +0000 |
|---|---|---|
| committer | Claude <noreply@anthropic.com> | 2026-05-13 20:35:51 +0000 |
| commit | 5d1c2d74d1e18e80b788e5778b10b94053343c2c (patch) | |
| tree | e84482e09a8aa40c5b83f292c21ba4f2ec96d5e0 /docs/Makefile | |
| parent | bad55da626f59fd84e85e8f6d9a826ae1f0b8860 (diff) | |
| download | vyos-documentation-5d1c2d74d1e18e80b788e5778b10b94053343c2c.tar.gz vyos-documentation-5d1c2d74d1e18e80b788e5778b10b94053343c2c.zip | |
doc-linter: realpath() resolution, DOCS_ROOT in walker, indent fix
Three Copilot findings on ab497bf:
1. is_docs_path() docstring claimed paths 'resolve' under docs/, but
the implementation only normalized via abspath() — a symlink under
docs/ that points outside the tree would be treated as in-scope.
Switch both inputs to os.path.realpath() so symlinks are followed
to their real targets. The reverse case is also handled: if docs/
is itself a symlink (some CI checkouts), realpath() resolves it
consistently for both sides of the commonpath comparison.
Verified with a synthetic case: docs/poison.md -> /etc/hosts now
returns False (with abspath() it returned True).
2. The auto-discover fallback in main() still hardcoded
os.walk('docs') instead of using the new DOCS_ROOT constant.
Use DOCS_ROOT in both paths so the docs root is configured in
exactly one place.
3. Indentation inside 'for file in files:' was double-indented (8
spaces under the for, instead of 4) — pre-existing oddity from
before 65a8e9f, preserved through the is_docs_path() addition.
Normalize to a single indent level under the loop.
CI behavior unchanged: tj-actions/changed-files passes repo-relative
paths with no symlinks under docs/, which were already handled. The
realpath() switch only changes behavior in the symlink-escape case,
which was a bug.
Diffstat (limited to 'docs/Makefile')
0 files changed, 0 insertions, 0 deletions
