Skip to content

Commit

Permalink
fix path instructions example
Browse files Browse the repository at this point in the history
  • Loading branch information
harjotgill committed Mar 28, 2024
1 parent 5a23ac4 commit 1a89781
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion docs/guides/configure-coderabbit.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ reviews:
review_status: true
collapse_walkthrough: false
path_filters:
- "!**/.xml"
- "!**/*.xml"
path_instructions:
- path: "**/*.js"
instructions:
Expand Down
26 changes: 14 additions & 12 deletions docs/guides/review-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,9 @@ description:
This section explains how to add custom code review instructions for the entire
project or specific file paths in your project using glob patterns. Developers
can provide tailored review guidelines based on the file paths. These
instructions are needed only if you want the reviewer to follow specific
instructions besides the standard review.

Adding file path prompts allows developers to specify custom instructions for
different parts of the codebase. For example, you may want to enforce a style
guide by file types or directories.
instructions are needed only if you want CodeRabbit to follow specific
instructions besides the standard review. For example, you may want to enforce a
style guide by file types or directories.

### Sample Usage

Expand All @@ -35,16 +32,21 @@ guide by file types or directories.

:::note

- Paths accept glob patterns.
- Instructions generally work well for specific additional instructions.
However, they are not that effective if you are instructing AI not to do
something.
- Test the review feedback on pull requests and tailor as necessary.
Paths accept glob patterns. See the
[minimatch](https://github.com/isaacs/minimatch) documentation for more
information.

:::

## Abstract Syntax Tree (AST) based instructions {#ast-based}

CodeRabbit offers review instructions based on Abstract Syntax Tree (AST)
patterns. Under the hood, CodeRabbit uses
[`ast-grep`](https://ast-grep.github.io) to power this feature. `ast-grep` is
written in Rust and uses the tree-sitter parser to generate the AST for popular
languages. `ast-grep` is written and maintained by
[Herrington Darkholme](https://twitter.com/hd_nvim).

:::note

**Deep dive into AST patterns and `ast-grep` rules**
Expand Down Expand Up @@ -117,7 +119,7 @@ rule:
matches: "utility-rule"
```
### Three Rule Categories
### Rule Categories
To summarize the rule object fields above, we have three categories of rules:
Expand Down

0 comments on commit 1a89781

Please sign in to comment.