Skip to content

Commit 4af838c

Browse files
committed
Release v0.1.9: Fix OutputFormat casefold AttributeError with string-based enum
1 parent b742ac3 commit 4af838c

File tree

1 file changed

+25
-17
lines changed

1 file changed

+25
-17
lines changed

README.md

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -76,17 +76,18 @@ To view the available options and commands, run `codeanalyzer --help`. You shoul
7676
Static Analysis on Python source code using Jedi, CodeQL and Tree sitter.
7777

7878

79-
╭─ Options ──────────────────────────────────────────────────────────────────────────────────────────────────────────╮
80-
* --input -i PATH Path to the project root directory. [default: None] [required] │
81-
│ --output -o PATH Output directory for artifacts. [default: None] │
82-
│ --analysis-level -a INTEGER 1: symbol table, 2: call graph. [default: 1] │
83-
│ --codeql --no-codeql Enable CodeQL-based analysis. [default: no-codeql] │
84-
│ --eager --lazy Enable eager or lazy analysis. Defaults to lazy. [default: lazy] │
85-
│ --cache-dir -c PATH Directory to store analysis cache. [default: None] │
86-
│ --clear-cache --keep-cache Clear cache after analysis. [default: clear-cache] │
87-
│ -v INTEGER Increase verbosity: -v, -vv, -vvv [default: 0] │
88-
│ --help Show this message and exit. │
89-
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
79+
╭─ Options ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
80+
* --input -i PATH Path to the project root directory. [default: None] [required] │
81+
│ --output -o PATH Output directory for artifacts. [default: None] │
82+
│ --format -f [json|msgpack] Output format: json or msgpack. [default: json] │
83+
│ --analysis-level -a INTEGER 1: symbol table, 2: call graph. [default: 1] │
84+
│ --codeql --no-codeql Enable CodeQL-based analysis. [default: no-codeql] │
85+
│ --eager --lazy Enable eager or lazy analysis. Defaults to lazy. [default: lazy] │
86+
│ --cache-dir -c PATH Directory to store analysis cache. [default: None] │
87+
│ --clear-cache --keep-cache Clear cache after analysis. [default: clear-cache] │
88+
│ -v INTEGER Increase verbosity: -v, -vv, -vvv [default: 0] │
89+
│ --help Show this message and exit. │
90+
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
9091
```
9192

9293
### Examples
@@ -104,7 +105,14 @@ To view the available options and commands, run `codeanalyzer --help`. You shoul
104105

105106
Now, you can find the analysis results in `analysis.json` in the specified directory.
106107

107-
2. **Toggle analysis levels with `--analysis-level`:**
108+
2. **Change output format to msgpack:**
109+
```bash
110+
codeanalyzer --input ./my-python-project --output /path/to/analysis-results --format msgpack
111+
```
112+
113+
This will save the analysis results in `analysis.msgpack` in the specified directory.
114+
115+
3. **Toggle analysis levels with `--analysis-level`:**
108116
```bash
109117
codeanalyzer --input ./my-python-project --analysis-level 1 # Symbol table only
110118
```
@@ -114,30 +122,30 @@ To view the available options and commands, run `codeanalyzer --help`. You shoul
114122
```
115123
***Note: The `--analysis-level=2` is not yet implemented in this version.***
116124

117-
3. **Analysis with CodeQL enabled:**
125+
4. **Analysis with CodeQL enabled:**
118126
```bash
119127
codeanalyzer --input ./my-python-project --codeql
120128
```
121129
This will perform CodeQL-based analysis in addition to the standard symbol table generation.
122130

123131
***Note: Not yet fully implemented. Please refrain from using this option until further notice.***
124132

125-
4. **Eager analysis with custom cache directory:**
133+
5. **Eager analysis with custom cache directory:**
126134
```bash
127135
codeanalyzer --input ./my-python-project --eager --cache-dir /path/to/custom-cache
128136
```
129137
This will rebuild the analysis cache at every run and store it in `/path/to/custom-cache/.codeanalyzer`. The cache will be cleared by default after analysis unless you specify `--keep-cache`.
130138

131139
If you provide --cache-dir, the cache will be stored in that directory. If not specified, it defaults to `.codeanalyzer` in the current working directory (`$PWD`).
132140

133-
5. **Quiet mode (minimal output):**
141+
6. **Quiet mode (minimal output):**
134142
```bash
135143
codeanalyzer --input /path/to/my-python-project --quiet
136144
```
137145

138-
### Output
146+
## Output
139147

140-
By default, analysis results are printed to stdout in JSON format. When using the `--output` option, results are saved to `analysis.json` in the specified directory.
148+
By default, analysis results are printed to stdout in JSON format. When using the `--output` option, results are saved to `analysis.json` in the specified directory. If you use the `--format=msgpack` option, the results will be saved in `analysis.msgpack`, which is a binary format that can be more efficient for storage and transmission.
141149

142150
## Development
143151

0 commit comments

Comments
 (0)