How ignore_patterns in .no-mistakes.yaml Affect Pipeline Processing

The ignore_patterns list in .no-mistakes.yaml acts as a repository-wide filter that causes the pipeline to treat matching files as unchanged, excluding them from review, documentation, test evidence, and push steps.

The no-mistakes pipeline uses a centralized ignore pattern system to reduce noise from generated files, vendor directories, and other non-source assets. When you define ignore_patterns in your repository configuration, every pipeline step that examines changed files applies these Git-ignore-style patterns before processing. This ensures consistent filtering across reviews, documentation generation, and artifact management.

Where ignore_patterns Are Defined and Loaded

Configuration Structure

The ignore_patterns field is defined in the Config struct within internal/config/config.go:

type Config struct {
    // ... other fields ...
    IgnorePatterns []string `yaml:"ignore_patterns"`
}

This slice stores Git-ignore-style patterns that support wildcards (*), globstars (**), and directory-specific matching.

Repository-Level Loading

The pipeline loads .no-mistakes.yaml from the repository's default branch during initialization. The parsing logic in internal/config/config_repo.go populates sctx.Config.IgnorePatterns with the YAML values. According to the no-mistakes source code, this configuration becomes part of the shared pipeline context (sctx) available to all steps.

How Each Pipeline Step Applies ignore_patterns

Review Step (internal/pipeline/steps/review.go)

The review step builds a comma-separated string of patterns from sctx.Config.IgnorePatterns and checks each changed file before including it in the AI-generated review prompt:

if len(sctx.Config.IgnorePatterns) > 0 {
    ignorePatterns = strings.Join(sctx.Config.IgnorePatterns, ", ")
}
// ...
for _, file := range changedFiles {
    ignored := false
    for _, pattern := range sctx.Config.IgnorePatterns {
        if matchIgnorePattern(file, pattern) {
            ignored = true
            break
        }
    }
    if ignored {
        continue // file excluded from review
    }
    // normal review processing...
}

Files matching any pattern are silently skipped—no findings are generated for them.

Document Step (internal/pipeline/steps/document.go)

The document step uses identical pattern handling. It calls hasNonIgnoredDocumentChanges to determine whether any changes remain after filtering. If all changes match ignore patterns, the step aborts early with no document generation.

Test Evidence Step (internal/pipeline/steps/test.go)

Before committing test evidence files, this step runs git check-ignore on each path, leveraging the same ignore patterns. Matching files are dropped from the evidence set, preventing generated test artifacts from being pushed as evidence.

Push Step (internal/pipeline/steps/push.go)

When staging artifacts for remote push, the push step applies the ignore list to filter which files (including images and other binary assets) are included in the commit.

Centralized Pattern Matching Logic

All steps rely on internal/pipeline/steps/common_diff.go for consistent ignore semantics:

  • matchIgnorePattern(path, patterns) — Implements Git-ignore wildcard matching, including ** for recursive directory matching and trailing slashes for directory-only patterns
  • filterDiff(diffOutput, patterns) — Removes diff hunks where the file path matches any pattern, effectively treating those changes as nonexistent

This centralized approach ensures that a file ignored in the review step receives identical treatment in the document and test steps.

Practical Configuration Example


# .no-mistakes.yaml

ignore_patterns:
  - "*.generated.go"          # ignore all generated source files

  - "vendor/**"               # ignore everything under vendor/

  - "docs/generated/**"       # ignore generated docs

  - "package-lock.json"       # ignore lock files

With this configuration:

  • Code reviews skip generated Go files and vendored dependencies
  • Documentation generation ignores pre-generated docs under docs/generated/
  • Test evidence excludes artifacts in vendor/
  • Push operations omit package-lock.json from staged changes

Summary

  • ignore_patterns are repository-wide: Defined once in .no-mistakes.yaml, they affect every pipeline step uniformly
  • They use Git-ignore semantics: Support wildcards, globstars, and directory-specific matching via matchIgnorePattern in internal/pipeline/steps/common_diff.go
  • Matching files are silently excluded: No review findings, no documentation updates, and no evidence pushes occur for ignored paths
  • Configuration loads from default branch: Parsed at internal/config/config_repo.go and stored in sctx.Config.IgnorePatterns

Use ignore_patterns to keep generated, vendored, or machine-managed files out of the AI-driven automation loop while maintaining clean, focused reviews on meaningful source changes.

Frequently Asked Questions

What pattern syntax does no-mistakes support for ignore_patterns?

The ignore_patterns field uses Git-ignore-style syntax as implemented in matchIgnorePattern within internal/pipeline/steps/common_diff.go. This includes * for wildcards, ** for recursive directory matching, and trailing slashes to match directories only. The function handles pattern negation and path anchoring consistent with standard .gitignore behavior.

Can ignore_patterns be overridden per-step or per-branch?

According to the source code analysis, ignore_patterns loads from the default branch's .no-mistakes.yaml through internal/config/config_repo.go. The configuration is stored in the shared pipeline context (sctx) and applied uniformly across all steps. There is no indication of step-specific or branch-specific override mechanisms in the reviewed code.

Why would files still appear in git diff if they're in ignore_patterns?

The ignore_patterns in .no-mistakes.yaml filter pipeline processing, not Git itself. Files matching these patterns remain in your repository and appear in git diff output. The filterDiff function in internal/pipeline/steps/common_diff.go removes matching sections from the diff data structures that steps use internally, but the underlying Git history and working tree remain unchanged.

How do ignore_patterns affect step skipping logic?

Steps like document use hasNonIgnoredDocumentChanges to determine if any actionable work remains after filtering. If ignore_patterns cover all changed files, the step determines no work is needed and returns early. This prevents unnecessary AI API calls and commit operations when only ignored files have changed.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →