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
{{ message }}
This repository was archived by the owner on May 4, 2023. It is now read-only.
### Analyze and report issues for a file or directory
74
+
75
+
#### Single File
76
+
77
+
To analyze a single file named `file.js` you can could run the following commands. The first command would analyze `file.js` for violations with the rules found in `foo-ruleset` and the second command would include the rules from `bar-ruleset` too.
> When analyzing a single file, a valid ruleset must be set using the `--ruleset` option.
88
+
89
+
#### Directory
90
+
91
+
To analyze a directory and all the files within, you could run any of the following commands to target the directory `foo`.
92
+
93
+
```bash
94
+
codiga analyze foo
95
+
```
96
+
97
+
```bash
98
+
codiga analyze ./foo
99
+
```
100
+
101
+
```bash
102
+
codiga analyze /Users/cool-name/foo
103
+
```
104
+
105
+
When analyzing a directory it isn't necessary to specify a ruleset using `--ruleset`, **if** you have a `codiga.yml` file in the targeted directory. If there isn't a `codiga.yml` and you haven't specified rulesets in the command, the analyze will exit.
106
+
107
+
> You can find rulesets to use on the [Codiga Hub](https://app.codiga.io/hub/rulesets) or you can use a command introduced above `codiga ruleset-add` to create a `codiga.yml` quickly.
108
+
109
+
#### Options
110
+
111
+
-`-r/--ruleset`
112
+
- Specify the rulesets you want your analysis done with
113
+
-**Required:** when analyzing a single file or when there isn't a `codiga.yml` in the root targeted directory
114
+
-**Default:**`codiga.yml`
115
+
-**Notes:** if set, will override a `codiga.yml`
116
+
-`-f/--format`
117
+
- Specify the format you want your analysis reported in
118
+
-**Options:**`text`, `json`, `csv`
119
+
-**Default:**`text`
120
+
-`-o/--output`
121
+
- Specify where you want your analysis reported to
0 commit comments