Skip to content

feat: add --ignore-file filtering#512

Open
macayu17 wants to merge 3 commits into
Boeing:mainfrom
macayu17:fix/457-ignore-file
Open

feat: add --ignore-file filtering#512
macayu17 wants to merge 3 commits into
Boeing:mainfrom
macayu17:fix/457-ignore-file

Conversation

@macayu17
Copy link
Copy Markdown
Contributor

Closes #457.

Summary

Adds a repeatable --ignore-file flag for gitignore-style pattern files such as .dockerignore and .prettierignore. Each file is resolved relative to the search path root, missing files are skipped, and multiple ignore files are additive.

This also wires the same behavior through ignore-files in .cfv.toml and the comma-separated CFV_IGNORE_FILES environment variable. The new behavior is covered in finder unit tests and CLI testscript cases, with docs updated for the new flag, config key, and env var.

Verification

  • go test ./pkg/finder ./pkg/configfile ./cmd/validator -run "Test_fsFinderGitignore|Test_fsFinderIgnoreFiles| Test_fsFinderMultipleIgnoreFiles|TestLoadValid|Test_ignoreFilesEnvVar|Test_getFlags|TestScript/ignore_file" -count=1
  • Full local pipeline in a Linux container: go vet, gofmt, golangci-lint, go generate diff check, Linux
    build, go test -cover ./..., nested justfile tests
  • Coverage: 93.3%

Copilot AI review requested due to automatic review settings May 28, 2026 03:12
@macayu17 macayu17 requested a review from a team as a code owner May 28, 2026 03:12
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds support for applying additional gitignore-style ignore files during file discovery, configurable via CLI flag, config file key, and environment variable.

Changes:

  • Introduces --ignore-file (repeatable) and ignore-files config key, plus CFV_IGNORE_FILES env var support.
  • Extends filesystem finder to load ignore patterns from explicit ignore files (even when not in a Git repo).
  • Updates docs, schema, changelog, and adds unit/integration tests covering the new behavior.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
website/docs/reference/environment-variables.md Documents CFV_IGNORE_FILES mapping and format.
website/docs/reference/configuration-keys.md Adds ignore-files config key to the reference table.
website/docs/reference/cli-flags.md Adds -ignore-file to CLI flags reference.
website/docs/guides/filtering-exclusion.md Adds a guide section explaining ignore files and updates evaluation order.
website/docs/guides/configuration-file.md Adds ignore-files to examples and key table.
pkg/finder/fsfinder.go Implements loading ignore patterns from explicit ignore files.
pkg/finder/finder_test.go Adds unit tests for ignore-file behavior.
pkg/configfile/schema.json Adds JSON schema entry for ignore-files.
pkg/configfile/configfile_test.go Adds config parsing test for ignore-files.
pkg/configfile/configfile.go Adds IgnoreFiles field to config struct.
cmd/validator/validator_test.go Adds tests for --ignore-file flags and CFV_IGNORE_FILES.
cmd/validator/validator.go Adds --ignore-file, env var parsing, config-file application, and wiring into finder opts.
cmd/validator/testdata/ignore_file.txtar Adds integration-style test scenarios for ignore files.
CHANGELOG.md Notes the new --ignore-file option.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pkg/finder/fsfinder.go Outdated
Comment thread website/docs/reference/environment-variables.md Outdated
@kehoecj kehoecj added OSS Community Contribution Contributions from the OSS Community waiting-on-maintainer-review PR is waiting to be reviewed and functionally tested by the maintainers labels May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OSS Community Contribution Contributions from the OSS Community waiting-on-maintainer-review PR is waiting to be reviewed and functionally tested by the maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add --ignore-file flag for .dockerignore, .prettierignore, etc.

3 participants