Skip to content

Commit ce981ff

Browse files
fix: document files/ignores behavior
1 parent 3da5fe3 commit ce981ff

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

website/guide/project/lint-rule.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,8 @@ Be sure to remove `./` to the beginning of your rules. ast-grep will not recogni
154154

155155
:::
156156

157+
Paths in both `files` and `ignores` are relative to the project root directory, that is, `sgconfig.yml`'s directory.
158+
157159
## Customize Code Highlighting
158160

159161
ast-grep will report linting issues with highlighted code span called label. A label describes an underlined region of code associated with an issue. _By default, the matched target code and its surrounding code captured by [relational rules](/guide/rule-config/relational-rule.html)_.

website/reference/yaml.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,8 @@ files:
253253
Be sure to remove `./` to the beginning of your rules. ast-grep will not recognize the paths if you add `./`.
254254
:::
255255

256+
Paths in `files` are relative to the project root directory, that is, `sgconfig.yml`'s directory.
257+
256258

257259
### `ignores`
258260
* type: `Array<String>`
@@ -279,6 +281,7 @@ To disable this behavior, use [`--no-ignore`](/reference/cli.html#scan) in CLI.
279281
`ignores` is a rule-wise configuration that only filters files that are not ignored by the CLI.
280282
:::
281283

284+
Paths in `ignores` are relative to the project root directory, that is, `sgconfig.yml`'s directory.
282285

283286
## Other
284287

0 commit comments

Comments
 (0)