| 用法 | semgrep --config auto / --config <规则文件> |
|---|---|
| 规则 | YAML 声明 pattern 与 message |
| 场景 | 自定义反模式、安全规则 |
运行示例
运行示例
semgrep --config auto
semgrep --config p/ci --severity ERROR
# 自定义规则文件 rules.yaml 可纳入仓库评审自定义规则把复盘经验固化为检查:同类问题第二次出现时由工具自动指出。
Semgrep 用近似语法的模式(pattern)在代码中搜索反模式:自带 registry 规则集,也可写项目自定义规则,适合把团队事故经验沉淀成可执行检查。
| 用法 | semgrep --config auto / --config <规则文件> |
|---|---|
| 规则 | YAML 声明 pattern 与 message |
| 场景 | 自定义反模式、安全规则 |
semgrep --config auto
semgrep --config p/ci --severity ERROR
# 自定义规则文件 rules.yaml 可纳入仓库评审