Skip to content

Commit 319eab6

Browse files
committed
added a section about the config file
1 parent d13baba commit 319eab6

File tree

1 file changed

+29
-2
lines changed

1 file changed

+29
-2
lines changed

README.md

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ This repository provides an alternative implementation to [Polystat](https://git
99
* A **directory** with the `.sarif.json` files, where each SARIF file corresponds to the file in the input directory.
1010
* An **single file** where the outputs of the analyzers for all the analyzed files are aggregated in a single SARIF JSON object.
1111

12-
...and many minor quality-of-life improvements.
12+
...and many minor quality-of-life improvements.
13+
14+
⚠ WARNING ⚠: The tool is still in the early stages of development, so feature suggestions and bug reports are more than welcome!
1315

1416
# Installation
1517
The CLI is distributed as a fat jar (can be downloaded from [Github Releases](https://github.com/polystat/polystat-cli/releases)), so you can run without any prerequisites other than the [JRE](https://ru.wikipedia.org/wiki/Java_Runtime_Environment). If you have it installed, you can run `polystat-cli` by just executing:
@@ -80,8 +82,8 @@ $ polystat eo --in tmp --sarif --to dir=polystat_out
8082
```
8183

8284

83-
8485
# <a name="full"></a> Full Usage Specification
86+
This section covers all the options available in the CLI interface and their meanings.
8587

8688
## Notation
8789
The description follows [this guide](https://en.wikipedia.org/wiki/Command-line_interface#Command_description_syntax).
@@ -140,6 +142,31 @@ If it's not present in the current working directory, download one from Maven Ce
140142
* `--help` displays some informative help message for commands.
141143
* `--config <path>` allows to configure Polystat from the specified HOCON config file. If not specified, reads configs from the file `.polystat.conf` in the current working directory.
142144

145+
# Configuration File
146+
This section covers all the keys that can be used in the HOCON configuration files. The most relevant version of the information presented in this section can be printed to console by running:
147+
```
148+
$ polystat list --config
149+
```
150+
The example of the working config file can be found [here](.polystat.conf).
151+
152+
* `polystat.lang` - the type of input files which will be analyzed. This key must be present. Possible values:
153+
* "java" - only ".java" files will be analyzed.
154+
* "eo" - only ".eo" files will be analyzed.
155+
* "python" - only ".py" files will be analyzed.
156+
* `polystat.j2eoVersion` - specifies the version of J2EO to download.
157+
* `polystat.j2eo` - specifies the path to the J2EO executable. If not specified, defaults to looking for j2eo.jar in the current working directory. If it's not found, downloads it from maven central. The download only happens when this key is NOT provided.
158+
* `polystat.input` - specifies how the files are supplied to the analyzer. Can be either a path to a directory, path to a file, or absent. If absent, the code is read from standard input.
159+
* `polystat.tempDir` - the path to a directory where temporary analysis file will be stored. If not specified, defaults to an OS-generated temporary directory.
160+
* `polystat.outputTo` - the path to a directory where the results of the analysis are stored. If not specified, the results will be printed to console.
161+
* `polystat.outputFormats` - the formats for which output is generated. If it's an empty list or not specified, no output files are produced.
162+
* `polystat.includeRules` | `polystat.excludeRules` - specified which rules should be included in / excluded from the analysis. If both are specified, polystat.includeRules takes precedence. The list of available rule specifiers can be found by running:
163+
```
164+
$ polystat.jar list
165+
```
166+
* `polystat.outputs.console` - specifies if the analysis results should be output to console. `false` by default.
167+
* `polystat.outputs.dirs` - a list of directories to write files to.
168+
* `polystat.outputs.files` - a list of files to write aggregated output to.
169+
143170
# Development
144171
## Setup
145172
This is an sbt Scala project. In order to build the project you need the following:

0 commit comments

Comments
 (0)