> ## 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.

# Review Configuration

> Configure which files CodeAnt AI reviews in your pull requests

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:

```json theme={null}
{
  "file_filters": {
    "config": {
      "include_files": ["src/*.js", "src/*.ts"],
      "exclude_files": ["*test.js", "*test.ts"]
    }
  }
}
```

Equivalent comma-separated form:

```json theme={null}
{
  "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`](https://docs.python.org/3/library/fnmatch.html) 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`             |

**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

```json theme={null}
{
  "file_filters": {
    "config": {
      "include_files": [],
      "exclude_files": ["*test.js", "*test.ts"]
    }
  }
}
```

### Include Only Source Code

```json theme={null}
{
  "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.

```json theme={null}
{
  "file_filters": {
    "config": {
      "include_files": ["src/*.js", "src/*.ts", "src/*.jsx", "src/*.tsx"],
      "exclude_files": []
    }
  }
}
```

## 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,*.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.
