Skip to content

Commit 06cf516

Browse files
fix: rename command name part 5
1 parent effb2eb commit 06cf516

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

website/catalog/rule-template.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
language: JavaScript # please fully spell the language
33
playgroundLink: '[TODO]'
4-
command: 'sg -p [TODO] -r [TODO]'
4+
command: 'ast-grep -p [TODO] -r [TODO]'
55
hasFix: true
66
ruleType: 'pattern' # 'pattern' or 'yaml'
77
---
@@ -20,9 +20,9 @@ Some Description for your rule!
2020
### Pattern
2121

2222
```shell
23-
sg -p pattern -r rewrite -l js
23+
ast-grep -p pattern -r rewrite -l js
2424
# or without fixer
25-
sg -p pattern -l js
25+
ast-grep -p pattern -l js
2626
```
2727

2828
<!-- Use YAML in the example. Delete this section if use pattern. -->

website/guide/scan-project.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22

33
Let's explore its power to run scan on your code repository in a scalable way!
44

5-
`sg scan` is the command you can use to run multiple rules against your repository so that you don't need to pass pattern query to your command line every time.
5+
`ast-grep scan` is the command you can use to run multiple rules against your repository so that you don't need to pass pattern query to your command line every time.
66

77
However, to ast-grep's scan need some scaffolding for project setup. We will walk through the process in this guide.
88

99
:::tip
10-
`sg scan` requires at least one file and one directory to work:
10+
`ast-grep scan` requires at least one file and one directory to work:
1111
* `sgconfig.yml`, the [project configuration](/reference/sgconfig.html) file
1212
* a directory storing rule files, usually `rules/`
1313
:::
1414

1515
## Create Scaffolding
1616

17-
To set up ast-grep's scanning, you can simply run the command `sg new` in the root directory of your repository. You will be guided with a series of interactive questions, like the following:
17+
To set up ast-grep's scanning, you can simply run the command `ast-grep new` in the root directory of your repository. You will be guided with a series of interactive questions, like the following:
1818

1919
```markdown
2020
No sgconfig.yml found. Creating a new ast-grep project...
@@ -38,7 +38,7 @@ my-awesome-project
3838

3939
## Create the Rule
4040

41-
Now you can start creating a rule! Continue using `sg new`, it will ask you what to create. But you can also use `sg new rule` to create a rule directly!
41+
Now you can start creating a rule! Continue using `ast-grep new`, it will ask you what to create. But you can also use `ast-grep new rule` to create a rule directly!
4242

4343
You will be asked several questions about the rule going to be created. Suppose we want to create a rule to ensure no eval in JavaScript.
4444

@@ -86,7 +86,7 @@ Okay! The pattern syntax works just like what we have learnt before.
8686
8787
Now you can try scanning the code! You can create a JavaScript file containing `eval` to test it.
8888

89-
Run `sg scan` in your project, ast-grep will give you some beautiful scan report!
89+
Run `ast-grep scan` in your project, ast-grep will give you some beautiful scan report!
9090

9191
```bash
9292
error[no-eval]: Add your rule message here....
@@ -106,6 +106,6 @@ In this section we learnt how to set up ast-grep project, create new rules using
106106

107107
To summarize the commands we used:
108108

109-
* `sg new` - Create a new ast-grep project
110-
* `sg new rule` - Create a new rule in a rule folder.
111-
* `sg scan` - Scan the codebase with the rules in the project.
109+
* `ast-grep new` - Create a new ast-grep project
110+
* `ast-grep new rule` - Create a new rule in a rule folder.
111+
* `ast-grep scan` - Scan the codebase with the rules in the project.

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