fix: avoid path claims for non-path inline code#83
Conversation
- Skip inline IP/CIDR values, file extensions, shell commands, and dotted annotation keys when extracting path claims - Add regression coverage for Kubernetes/GitOps-style inline code snippets
theDakshJaitly
left a comment
There was a problem hiding this comment.
Thanks for the focused hardening here. The overall direction makes sense, especially after #80, since ROUTER.md can still contain inline values that look path-like but are not filesystem paths.
I found one false-negative risk before approving: DOTTED_KEY_WITH_SLASH also matches valid root hidden-directory paths like .github/CODEOWNERS and .github/workflows. Those are realistic scaffold references, and this change would stop extracting them as path claims, so checkPaths would no longer validate them.
Could you tighten that matcher so Kubernetes-style dotted annotation/config keys are skipped without excluding .github/... paths? A regression test for .github/CODEOWNERS or .github/workflows would cover it.
Summary
Why
checkPathscurrently treats many backtick-wrapped values as path claims when they contain/or a known extension. In project docs this creates noisyMISSING_PATHerrors for Kubernetes/GitOps notes like192.168.5.0/24,argocd.argoproj.io/sync-wave,sudo ls /var/lib/kubelet/plugins_registry/, or.yaml.Those are inline code snippets, not files the scaffold depends on.
Testing
npm test -- test/claims.test.tsnpm test -- test/checkers.test.tsnpm run typecheckgit diff --check