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

> Learn how ignore_patterns in .no-mistakes.yaml filter files, excluding them from pipeline review, documentation, and testing steps to streamline your workflow.

- Repository: [Kun Chen/no-mistakes](https://github.com/kunchenguid/no-mistakes)
- Tags: how-to-guide
- Published: 2026-07-01

---

**The `ignore_patterns` list in [`.no-mistakes.yaml`](https://github.com/kunchenguid/no-mistakes/blob/main/.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`](https://github.com/kunchenguid/no-mistakes/blob/main/internal/config/config.go):

```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`](https://github.com/kunchenguid/no-mistakes/blob/main/.no-mistakes.yaml) from the repository's default branch during initialization. The parsing logic in [`internal/config/config_repo.go`](https://github.com/kunchenguid/no-mistakes/blob/main/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:

```go
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`](https://github.com/kunchenguid/no-mistakes/blob/main/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

```yaml

# .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`](https://github.com/kunchenguid/no-mistakes/blob/main/package-lock.json) from staged changes

## Summary

- **ignore_patterns are repository-wide**: Defined once in [`.no-mistakes.yaml`](https://github.com/kunchenguid/no-mistakes/blob/main/.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`](https://github.com/kunchenguid/no-mistakes/blob/main/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`](https://github.com/kunchenguid/no-mistakes/blob/main/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`](https://github.com/kunchenguid/no-mistakes/blob/main/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`](https://github.com/kunchenguid/no-mistakes/blob/main/.no-mistakes.yaml) through [`internal/config/config_repo.go`](https://github.com/kunchenguid/no-mistakes/blob/main/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`](https://github.com/kunchenguid/no-mistakes/blob/main/.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`](https://github.com/kunchenguid/no-mistakes/blob/main/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.