Skip to content

Commit 1ae4bdf

Browse files
doc: update inspect
1 parent 5b08579 commit 1ae4bdf

File tree

3 files changed

+24
-8
lines changed

3 files changed

+24
-8
lines changed

website/reference/cli.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ sg run [OPTIONS] --pattern <PATTERN> [PATHS]...
3535
| -U| --update-all | Apply all rewrite without confirmation if true. |
3636
| | --json`[=<STYLE>]` | Output matches in structured JSON [possible values: pretty, stream, compact] |
3737
| | --color `<WHEN>` | Controls output color [default: auto] |
38-
| | --tracing `<LEVEL>` | Show tracing information for file/rule discovery and scanning [default: nothing] [possible values: nothing, summary]
38+
| | --inspect `<GRANULARITY>` | Inspect information for file/rule discovery and scanning [default: nothing] [possible values: nothing, summary, entity]|
3939
| | --heading `<WHEN>` | Controls whether to print the file name as heading [default: auto] [possible values: auto, always, never] |
4040
| -A| --after `<NUM>` | Show NUM lines after each match [default: 0] |
4141
| -B| --before `<NUM>` | Show NUM lines before each match [default: 0] |
@@ -73,7 +73,7 @@ sg scan [OPTIONS] [PATHS]...
7373
| | --no-ignore `<NO_IGNORE>` | Do not respect ignore files. (.gitignore, .ignore, etc.) [possible values: hidden, dot, exclude, global, parent, vcs] |
7474
| | --stdin | Enable search code from StdIn. See [link](/guide/tooling-overview.html#enable-stdin-mode) |
7575
| | --globs `<GLOBS>` | Include or exclude file paths
76-
| | --tracing `<LEVEL>` | Show tracing information for file/rule discovery and scanning [default: nothing] [possible values: nothing, summary]
76+
| | --inspect `<GRANULARITY>` | Inspect information for file/rule discovery and scanning [default: nothing] [possible values: nothing, summary, entity]|
7777
| | --error`[=<RULE_ID>...]`| Set rule severity to error
7878
| | --warning`[=<RULE_ID>...]`| Set rule severity to warning
7979
| | --info`[=<RULE_ID>...]`| Set rule severity to info

website/reference/cli/run.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,17 +155,25 @@ Possible values:
155155
- **always**: Always print heading regardless of output type
156156
- **never**: Never print heading regardless of output type
157157

158-
### `--tracing <LEVEL>`
158+
### `--inspect <GRANULARITY>`
159+
Inspect information for file/rule discovery and scanning.
159160

160-
Show tracing information for file/rule discovery and scanning.
161+
This flag helps user to observe ast-grep's internal filtering of files and rules. Inspection will output how many and why files and rules are scanned and skipped. Inspection outputs to stderr and does not affect the result of the search.
161162

162-
This flag helps user to inspect ast-grep's internal filtering of files and rules. tracing will output how many and why files and rules are scanned and skipped. tracing information outputs to stderr and does not affect the result of the search.
163+
The format of the output is informally defined as follows:
164+
165+
```
166+
sg: <GRANULARITY>|<ENTITY_TYPE>|<ENTITY_IDENTIFIERS_SEPARATED_BY_COMMA>: KEY=VAL
167+
```
168+
169+
The [Extended Backus–Naur form](https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form) notation is specified in the [issue](https://github.com/ast-grep/ast-grep/issues/1574).
163170

164171
[default: nothing]
165172

166173
Possible values:
167174
- **nothing**: Do not show any tracing information
168175
- **summary**: Show summary about how many files are scanned and skipped
176+
- **entity**: Show per-file/per-rule tracing information
169177

170178
## Context Options
171179

website/reference/cli/scan.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,17 +102,25 @@ Possible values:
102102
- stream: Prints each match as a separate JSON object, followed by a newline character. This is useful for streaming the output to other programs that can read one object per line
103103
- compact: Prints the matches as a single-line JSON array, without any whitespace. This is useful for saving space and minimizing the output size
104104

105-
### `--tracing <LEVEL>`
105+
### `--inspect <GRANULARITY>`
106+
Inspect information for file/rule discovery and scanning.
106107

107-
Show tracing information for file/rule discovery and scanning.
108+
This flag helps user to observe ast-grep's internal filtering of files and rules. Inspection will output how many and why files and rules are scanned and skipped. Inspection outputs to stderr and does not affect the result of the search.
108109

109-
This flag helps user to inspect ast-grep's internal filtering of files and rules. tracing will output how many and why files and rules are scanned and skipped. tracing information outputs to stderr and does not affect the result of the search.
110+
The format of the output is informally defined as follows:
111+
112+
```
113+
sg: <GRANULARITY>|<ENTITY_TYPE>|<ENTITY_IDENTIFIERS_SEPARATED_BY_COMMA>: KEY=VAL
114+
```
115+
116+
The [Extended Backus–Naur form](https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form) notation is specified in the [issue](https://github.com/ast-grep/ast-grep/issues/1574).
110117

111118
[default: nothing]
112119

113120
Possible values:
114121
- **nothing**: Do not show any tracing information
115122
- **summary**: Show summary about how many files are scanned and skipped
123+
- **entity**: Show per-file/per-rule tracing information
116124

117125
### `--format <FORMAT>`
118126
Output warning/error messages in GitHub Action format.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy