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
Setup
1. Create Configuration Folder
Create a.codeant folder in your repository root (same level as your .git folder):
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:
How It Works
Default Behavior
- When both
include_filesandexclude_filesare empty: All files are reviewed - When only
exclude_fileshas patterns: All files except matches are reviewed - When only
include_fileshas patterns: Only matching files are reviewed - When both have patterns: Only
include_filesis evaluated;exclude_filesis 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 Pythonfnmatch syntax. Supported:
| Token | Meaning |
|---|---|
* | Matches any sequence of characters (including /) |
? | Matches a single character |
[seq] | Matches any character in seq |
[!seq] | Matches any character not in seq |
!pattern— leading!for negation (gitignore/minimatch convention){a,b}— brace expansion?(...),+(...),!(...)— extglob- Recursive
**semantics —*already matches/, so write*instead of**for “any depth”
* 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
Include Only Source Code
Narrowing With Include Only
When you want to scope reviews to source code while skipping tests and generated files, list the include patterns explicitly. Settingexclude_files alongside a non-empty include_files has no effect today.
Pattern Reference
Basic Patterns
| Pattern | Matches |
|---|---|
*.js | Any path ending in .js |
src/* | Anything under src/ (any depth, since * crosses /) |
*test*.py | Any .py file with test in its path |
src/*.py | .py files anywhere under src/ |
[Tt]est* | Files starting with Test or test |
Common Exclusions
| Pattern | Purpose |
|---|---|
*node_modules* | Dependencies |
*dist* | Build output |
*.min.js,*.min.css | Minified files |
*.generated.* | Generated code |
*coverage* | Test coverage |
*.env* | Environment files |
*vendor* | Third-party code |
*.png,*.jpg,*.gif,*.svg | Images (list each — no brace expansion) |
*package-lock.json | Lock files |
Common Inclusions
| Pattern | Purpose |
|---|---|
src/*.js,src/*.ts,src/*.jsx,src/*.tsx | Frontend source |
*.py | Python files |
app/*.rb | Ruby files |
*.cs,*.vb | .NET files |
*.java,*.kt | JVM files |
*.go | Go files |
*.rs | Rust files |
*.swift,*.m,*.h | iOS files |
Tips
- Multi-extension matches require listing each pattern (no
{a,b}): use*.js,*.tsinstead 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_filesfor the directories you want.