Hey all,
So the config-file-validator already supports excluding directories and file types through CLI flags and .cfv.toml, which is great. But in real repos, a lot of files we do not want to validate are already described in .gitignore or .ignore patterns. Right now that means users may need to duplicate ignore logic in multiple places.
It would be useful if the validator could optionally respect repository ignore rules during file discovery.
Proposed behavior
Add support for one of the following:
- a new flag such as
--respect-gitignore
- or automatic detection when running inside a Git repository
When enabled, the validator should skip files/directories ignored by:
.gitignore
.git/info/exclude
- optionally global Git ignore config
- optionally
.ignore
Why this would help
This would make the tool easier to use in larger repos and monorepos where generated/vendor/build output is already excluded from normal developer workflows.
Examples:
- skip generated config artifacts under build output
- avoid validating vendored third-party configs
- reduce duplication between
.gitignore and .cfv.toml
- make local runs behave closer to what developers already expect from Git-aware tooling
Example
Today:
validator --exclude-dirs=node_modules,.git,dist,build .
Proposed:
validator --respect-gitignore .
Sincerely,
Michael
Hey all,
So the
config-file-validatoralready supports excluding directories and file types through CLI flags and.cfv.toml, which is great. But in real repos, a lot of files we do not want to validate are already described in.gitignoreor.ignorepatterns. Right now that means users may need to duplicate ignore logic in multiple places.It would be useful if the validator could optionally respect repository ignore rules during file discovery.
Proposed behavior
Add support for one of the following:
--respect-gitignoreWhen enabled, the validator should skip files/directories ignored by:
.gitignore.git/info/exclude.ignoreWhy this would help
This would make the tool easier to use in larger repos and monorepos where generated/vendor/build output is already excluded from normal developer workflows.
Examples:
.gitignoreand.cfv.tomlExample
Today:
validator --exclude-dirs=node_modules,.git,dist,build .Proposed:
validator --respect-gitignore .Sincerely,
Michael