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
+25-6Lines changed: 25 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ Prints all the available config keys. The configuration file format is [HOCON](h
10
10
11
11
Get the plain text console output from analyzing Java files. The Java files are in the directory `src/main/java`.
12
12
13
-
> `polystat eo --in tmp --sarif --files polystat_out`
13
+
> `polystat eo --in tmp --sarif --to dir=polystat_out`
14
14
15
15
Write the [SARIF](https://docs.oasis-open.org/sarif/sarif/v2.1.0/sarif-v2.1.0.html) JSON files to `polystat_out/sarif` from analysing the `tmp` directory with `.eo` files.
16
16
@@ -21,8 +21,22 @@ Write the [SARIF](https://docs.oasis-open.org/sarif/sarif/v2.1.0/sarif-v2.1.0.ht
21
21
The description follows [this guide](https://en.wikipedia.org/wiki/Command-line_interface#Command_description_syntax).
22
22
> Note: {a | b | c} means a set of _mutually-exclusive_ items.
*`--include` and `--exclude` respectively define which rules should be included/excluded from the analysis run. These options are mutually exclusive, so specifying both should not be valid. If neither option is specified, all the available analyzers will be run. The list of available rule specifiers can be found via `polystat list` command.
37
-
*`--j2eo`options allows users to specify the path to the j2eo executable jar. If it's not specified, it looks for one in the current working diretory.
51
+
*`--j2eo`option allows users to specify the path to the j2eo executable jar. If it's not specified, it looks for one in the current working diretory.
38
52
If it's not present in the current working directory, download one from Maven Central (for now, the version is hardcoded to be 0.4.0).
53
+
*`--j2eo-version` option allows users to specify which version of `j2eo` should be downloaded.
39
54
40
55
## Output configuration
41
56
*`--sarif` option means that the command will produce the output in the [SARIF](https://docs.oasis-open.org/sarif/sarif/v2.1.0/sarif-v2.1.0.html) format in addition to output in other formats (if any).
42
-
*`--files <path>`option specifies whether the output should be written to the output directory instead of writing it to the console.
43
-
If the path is specified, the command will write the files to the given path. The path is assumed to be an empty directory. If it is not, its contents will be purged.
57
+
*`--to { console | dir=<path>| file=<path> }` is a repeatable option that specifies where the output should be written. If this option is not specified, no output is produced.
58
+
*`--to dir=<path>` means that the files will be written to the given path. The path is assumed to be an empty directory. If it is not, its contents will be purged.
44
59
* If an additional output format is specified (e.g. `--sarif`), then the files created by the analyzer will be written in the respective subdirectory. For example, in case of `--sarif`, the SARIF files will be located in `path/sarif/`. The console output is not written anywhere. Therefore, if none of the output format options (e.g. `--sarif`) are specified, no files are produced.
45
60
* The output format options (e.g. `--sarif`) also determine the extension of the output files. In case of `--sarif` the extension would be `.sarif.json`.
46
61
* If `--in` option specifies a directory, the structure of the output directory will be similar to the structure of the input directory.
47
62
* If `--in` specifies a single file, the file with the analysis output for this file will be written to the output directory.
48
63
* If `--in` is not specified, the generated file will be called `stdin` + the relevant extension.
49
64
65
+
*`--to file=<path>` means that the results of analysis for all the files will be written to the file at the given path. For example, for `--sarif` output format this will a JSON array of `sarif-log` objects.
66
+
67
+
*`--to console` specifies whether the output should be written to console. The specification doesn't prevent the user from specifying multiple instances of this option. In this case, the output will be written to console as if just one instance of `--to console` was present. If it's not present the output is not written to console.
68
+
50
69
## `polystat list`
51
70
* If `--config` or `-c` is specified, prints to console the description of all the possible configuration keys for the HOCON config file. If not, prints the specifiers for all the available analyzer rules.
0 commit comments