Skip to content

feat: Add glob pattern matching for --ignore-images and config file support#30

Merged
azu merged 2 commits intomainfrom
feature/ignore-images-glob-config
Apr 3, 2026
Merged

feat: Add glob pattern matching for --ignore-images and config file support#30
azu merged 2 commits intomainfrom
feature/ignore-images-glob-config

Conversation

@azu
Copy link
Copy Markdown
Owner

@azu azu commented Apr 3, 2026

Summary

Add glob-based pattern matching for --ignore-images and introduce .dockerfile-pin.yaml config file support. This replaces the previous simple string-contains matching with doublestar glob patterns, supporting wildcards (*, **, ?) and negation patterns (!) with last-match-wins semantics.

Changes

  • Replace simple strings.Contains matching with doublestar glob patterns for --ignore-images
  • Add .dockerfile-pin.yaml / .dockerfile-pin.yml config file for persistent ignore rules
  • Add --ignore-images flag to run command (previously only available on check)
  • Change --ignore-images from StringSlice to StringArray so each flag invocation is a separate pattern
  • Config file patterns merge with CLI flags; CLI flags are evaluated after config, giving them precedence
  • Add cmd/ignore.go with LoadConfig, MergeIgnorePatterns, ValidatePatterns, IsIgnored
  • Add comprehensive unit tests (cmd/ignore_test.go) and e2e tests
  • Update README with config file documentation and pattern syntax table

Breaking Changes

  • --ignore-images now uses glob matching instead of substring matching. Existing usage like --ignore-images scratch,mylocal must be changed to --ignore-images "scratch" --ignore-images "mylocal" (StringArray instead of StringSlice).

Test Plan

  • Unit tests for IsIgnored cover exact match, glob star, doublestar, ECR patterns, negation, last-match-wins, question mark wildcard
  • Unit tests for ValidatePatterns, LoadConfig, MergeIgnorePatterns
  • E2e tests for pin + ignore, check + ignore, and config file loading
  • All tests pass: go test ./...

close #26

azu and others added 2 commits April 3, 2026 21:53
…upport

- Replace simple string-contains matching with doublestar glob patterns
- Support negation patterns (!) with last-match-wins semantics
- Add .dockerfile-pin.yaml/.yml config file for persistent ignore rules
- Add --ignore-images flag to `run` command (previously only on `check`)
- Change --ignore-images from StringSlice to StringArray for proper repeatable flags
- Merge config file patterns with CLI flags (CLI takes precedence)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Check os.Chdir and os.WriteFile return values in ignore_test.go
- Remove trailing blank line in check.go
- Fix map literal alignment in e2e_test.go

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 4 additional findings.

Open in Devin Review

@azu azu merged commit 22ca45a into main Apr 3, 2026
3 checks passed
@azu azu deleted the feature/ignore-images-glob-config branch April 3, 2026 13:04
@github-actions github-actions Bot mentioned this pull request Apr 3, 2026
@azu azu added the Type: Feature New Feature label Apr 3, 2026
azu pushed a commit that referenced this pull request Apr 3, 2026
<!-- Release notes generated using configuration in .github/release.yml
at main -->

## What's Changed

### Features

* feat: Add glob pattern matching for --ignore-images and config file
support by @azu in #30

### Documentation
* Reorganize README examples: move glob patterns after write options by
@azu in #32
* docs: Add docker-compose.yml and GitHub Actions examples to README by
@azu in #31


**Full Changelog**:
v1.1.0...v1.2.0

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Feature New Feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support config file and glob/negation patterns for --ignore-images

1 participant