You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+21-6Lines changed: 21 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,15 +4,15 @@ This is a POC for what could be a new CLI for us. The idea is to rely on the nat
4
4
5
5
## Overview
6
6
7
-
The `codacy-cli-v2` is a command-line tool for Codacy that supports analyzing code using ESLint and uploading the results in SARIF format to Codacy. It provides two main commands: `analyze` and `upload`.
7
+
The `codacy-cli-v2` is a command-line tool for Codacy that supports analyzing code using ESLint, Trivy, and uploading the results in SARIF format to Codacy. It provides two main commands: `analyze` and `upload`.
8
8
9
9
### Commands
10
10
11
-
-**`analyze` Command**: Runs ESLint analysis on the codebase.
11
+
-**`analyze` Command**: Runs analysis tools on the codebase.
12
12
-`--output, -o`: Output file for the results.
13
-
-`--tool, -t`: Specifies the tool to run analysis with (e.g., ESLint).
13
+
-`--tool, -t`: Specifies the tool to run analysis with (e.g., ESLint, Trivy).
14
14
-`--format`: Output format (use 'sarif' for SARIF format to terminal).
15
-
-`--fix, -f`: Automatically fixes issues when possible.
15
+
-`--fix, -f`: Automatically fixes issues when possible (only applicable to certain tools).
16
16
-`--new-pr`: Creates a new GitHub PR with fixed issues.
17
17
18
18
-**`upload` Command With Project Token**: Uploads a SARIF file containing analysis results to Codacy.
@@ -30,14 +30,15 @@ The `codacy-cli-v2` is a command-line tool for Codacy that supports analyzing co
30
30
31
31
### Important Concepts
32
32
33
-
-**`.codacy/codacy.yaml`**: Configuration file to specify `node` and `eslint` versions for the CLI.
33
+
-**`.codacy/codacy.yaml`**: Configuration file to specify runtimes and tools versions for the CLI.
34
34
```yaml
35
35
runtimes:
36
36
- node@22.2.0
37
37
tools:
38
38
- eslint@9.3.0
39
+
- trivy@0.50.0
39
40
40
-
- **`codacy-cli-v2 install`**: Command to install the specified node and eslint versions before running analysis.
41
+
- **`codacy-cli-v2 install`**: Command to install the specified runtimes and tools before running analysis.
41
42
42
43
## Download
43
44
@@ -78,18 +79,32 @@ To run ESLint and output the results to the terminal:
78
79
codacy-cli analyze --tool eslint
79
80
```
80
81
82
+
To run Trivy vulnerability scanner:
83
+
84
+
```bash
85
+
codacy-cli analyze --tool trivy
86
+
```
87
+
81
88
To output results in SARIF format to the terminal:
0 commit comments