Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.codeant.ai/llms.txt

Use this file to discover all available pages before exploring further.

Control which files are included or excluded from automated PR reviews using simple pattern matching.

Overview

CodeAnt AI reviews all files in pull requests by default. Use review configuration to:
  • Focus reviews on critical code paths
  • Exclude test files or generated files
  • Optimize review time and relevance
Note: CodeAnt does not analyze files mentioned in .gitignore

Setup

1. Create Configuration Folder

Create a .codeant folder in your repository root (same level as your .git folder):
your-repo/
├── .git/
├── .codeant/
│   └── configuration.json
├── src/
└── package.json

2. Create Configuration File

Inside the .codeant folder, create a configuration.json file with your file filters.

Configuration Format

include_files and exclude_files accept either a comma-separated string or an array of strings — pick whichever you find more readable:
{
  "file_filters": {
    "config": {
      "include_files": ["src/*.js", "src/*.ts"],
      "exclude_files": ["*test.js", "*test.ts"]
    }
  }
}
Equivalent comma-separated form:
{
  "file_filters": {
    "config": {
      "include_files": "src/*.js,src/*.ts",
      "exclude_files": "*test.js,*test.ts"
    }
  }
}

How It Works

Default Behavior

  • When both include_files and exclude_files are empty: All files are reviewed
  • When only exclude_files has patterns: All files except matches are reviewed
  • When only include_files has patterns: Only matching files are reviewed
  • When both have patterns: Only include_files is evaluated; exclude_files is ignored. A file is reviewed if it matches at least one include pattern. To exclude something, narrow the include patterns instead of relying on exclude.

Pattern Syntax

Patterns use Python fnmatch syntax. Supported:
TokenMeaning
*Matches any sequence of characters (including /)
?Matches a single character
[seq]Matches any character in seq
[!seq]Matches any character not in seq
Not supported (these will be treated literally and silently fail to match what you expect):
  • !pattern — leading ! for negation (gitignore/minimatch convention)
  • {a,b} — brace expansion
  • ?(...), +(...), !(...) — extglob
  • Recursive ** semantics — * already matches /, so write * instead of ** for “any depth”
Because * already crosses directory boundaries, a pattern like *coverage* is the simplest way to match coverage/ at any depth. A pattern like **/coverage/** requires a / immediately before AND after coverage, so it will not match a top-level coverage/foo.py.

Configuration Examples

Exclude Test Files

{
  "file_filters": {
    "config": {
      "include_files": [],
      "exclude_files": ["*test.js", "*test.ts"]
    }
  }
}

Include Only Source Code

{
  "file_filters": {
    "config": {
      "include_files": [
        "src/*.js",
        "src/*.ts",
        "src/*.jsx",
        "src/*.tsx",
        "lib/*.js",
        "lib/*.ts"
      ],
      "exclude_files": []
    }
  }
}

Narrowing With Include Only

When you want to scope reviews to source code while skipping tests and generated files, list the include patterns explicitly. Setting exclude_files alongside a non-empty include_files has no effect today.
{
  "file_filters": {
    "config": {
      "include_files": ["src/*.js", "src/*.ts", "src/*.jsx", "src/*.tsx"],
      "exclude_files": []
    }
  }
}

Pattern Reference

Basic Patterns

PatternMatches
*.jsAny path ending in .js
src/*Anything under src/ (any depth, since * crosses /)
*test*.pyAny .py file with test in its path
src/*.py.py files anywhere under src/
[Tt]est*Files starting with Test or test

Common Exclusions

PatternPurpose
*node_modules*Dependencies
*dist*Build output
*.min.js,*.min.cssMinified files
*.generated.*Generated code
*coverage*Test coverage
*.env*Environment files
*vendor*Third-party code
*.png,*.jpg,*.gif,*.svgImages (list each — no brace expansion)
*package-lock.jsonLock files

Common Inclusions

PatternPurpose
src/*.js,src/*.ts,src/*.jsx,src/*.tsxFrontend source
*.pyPython files
app/*.rbRuby files
*.cs,*.vb.NET files
*.java,*.ktJVM files
*.goGo files
*.rsRust files
*.swift,*.m,*.hiOS files

Tips

  • Multi-extension matches require listing each pattern (no {a,b}): use *.js,*.ts instead of *.{js,ts}.
  • To exclude a subtree but keep an inner directory, current syntax cannot express override-style negation. Either narrow the exclude pattern to dodge the inner directory, or list explicit include_files for the directories you want.