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:
.codeant/configuration.json
.codeant/configuration.json
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:
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”
* 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
.codeant/configuration.json
Include Only Source Code
.codeant/configuration.json
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.
.codeant/configuration.json
Pattern Reference
Basic Patterns
Common Exclusions
Common Inclusions
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.