Skip to content

Commit ddd6df4

Browse files
committed
docs(readme): widen the --help block and add a GitHub release badge
- update_readme.py: pin typer.rich_utils.MAX_WIDTH to WIDTH (100). Typer caps help at MAX_WIDTH=80 regardless of COLUMNS, so CI rendered the box much narrower than a dev machine and the release doc-sync kept shrinking it. Pinning it makes the rendered help wide and byte-identical local vs CI. - README: regenerate the (now 100-wide) help block; add a GitHub release badge (github/v/release) alongside the PyPI / workflow / license badges.
1 parent c93c3f5 commit ddd6df4

2 files changed

Lines changed: 65 additions & 97 deletions

File tree

README.md

Lines changed: 55 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88

99
[![PyPI](https://img.shields.io/pypi/v/codeanalyzer-python?style=for-the-badge&logo=pypi&logoColor=white)](https://pypi.org/project/codeanalyzer-python/)
1010
[![Python](https://img.shields.io/pypi/pyversions/codeanalyzer-python?style=for-the-badge&logo=python&logoColor=white)](https://pypi.org/project/codeanalyzer-python/)
11-
[![Release](https://img.shields.io/github/actions/workflow/status/codellm-devkit/codeanalyzer-python/release.yml?style=for-the-badge&label=release&logo=github)](https://github.com/codellm-devkit/codeanalyzer-python/actions/workflows/release.yml)
11+
[![GitHub release](https://img.shields.io/github/v/release/codellm-devkit/codeanalyzer-python?style=for-the-badge&logo=github&label=GitHub&color=2dba4e)](https://github.com/codellm-devkit/codeanalyzer-python/releases/latest)
12+
[![Release](https://img.shields.io/github/actions/workflow/status/codellm-devkit/codeanalyzer-python/release.yml?style=for-the-badge&label=release&logo=githubactions&logoColor=white)](https://github.com/codellm-devkit/codeanalyzer-python/actions/workflows/release.yml)
1213
[![License](https://img.shields.io/badge/License-Apache%202.0-blue?style=for-the-badge)](./LICENSE)
1314

1415
</div>
@@ -133,102 +134,59 @@ $ canpy --help
133134
134135
Static Analysis on Python source code using Jedi, CodeQL and Tree sitter.
135136
136-
╭─ Options ────────────────────────────────────────────────────────────────────╮
137-
│ --input -i PATH Path to the │
138-
│ project root │
139-
│ directory (not │
140-
│ required for │
141-
│ --emit schema). │
142-
│ --output -o PATH Output directory │
143-
│ for artifacts. │
144-
│ --format -f [json|msgpack] Output format for │
145-
│ --emit json: json │
146-
│ or msgpack. │
147-
│ [default: json] │
148-
│ --emit [json|neo4j|sche Output target: │
149-
│ ma] json │
150-
│ (analysis.json, │
151-
│ default) | neo4j │
152-
│ (graph.cypher or │
153-
│ live Bolt push) | │
154-
│ schema (the Neo4j │
155-
│ schema.json │
156-
│ contract). │
157-
│ [default: json] │
158-
│ --app-name TEXT Logical │
159-
│ application name │
160-
│ for the graph │
161-
│ :PyApplication │
162-
│ anchor (default: │
163-
│ input dir name). │
164-
│ --neo4j-uri TEXT Push the graph to │
165-
│ a live Neo4j over │
166-
│ Bolt │
167-
│ (incremental); │
168-
│ omit to write │
169-
│ graph.cypher. │
170-
│ [env var: │
171-
│ NEO4J_URI] │
172-
│ --neo4j-user TEXT Neo4j username. │
173-
│ [env var: │
174-
│ NEO4J_USERNAME] │
175-
│ [default: neo4j] │
176-
│ --neo4j-password TEXT Neo4j password. │
177-
│ Prefer the env │
178-
│ var over the flag │
179-
│ (the flag is │
180-
│ visible in shell │
181-
│ history / process │
182-
│ list). │
183-
│ [env var: │
184-
│ NEO4J_PASSWORD] │
185-
│ [default: neo4j] │
186-
│ --neo4j-database TEXT Neo4j database │
187-
│ name (default: │
188-
│ server default). │
189-
│ [env var: │
190-
│ NEO4J_DATABASE] │
191-
│ --codeql --no-codeql Enable │
192-
│ CodeQL-based │
193-
│ analysis. │
194-
│ [default: │
195-
│ no-codeql] │
196-
│ --ray --no-ray Enable Ray for │
197-
│ distributed │
198-
│ analysis. │
199-
│ [default: no-ray] │
200-
│ --eager --lazy Enable eager or │
201-
│ lazy analysis. │
202-
│ Defaults to lazy. │
203-
│ [default: lazy] │
204-
│ --skip-tests --include-tests Skip test files │
205-
│ in analysis. │
206-
│ [default: │
207-
│ skip-tests] │
208-
│ --file-name PATH Analyze only the │
209-
│ specified file │
210-
│ (relative to │
211-
│ input directory). │
212-
│ --cache-dir -c PATH Directory to │
213-
│ store analysis │
214-
│ cache. Defaults │
215-
│ to │
216-
│ '.codeanalyzer' │
217-
│ in the input │
218-
│ directory. │
219-
│ --clear-cache --keep-cache Clear cache after │
220-
│ analysis. By │
221-
│ default, cache is │
222-
│ retained. │
223-
│ [default: │
224-
│ keep-cache] │
225-
│ -v INTEGER Increase │
226-
│ verbosity: -v, │
227-
│ -vv, -vvv │
228-
│ [default: 0] │
229-
│ --help Show this message │
230-
│ and exit. │
231-
╰──────────────────────────────────────────────────────────────────────────────╯
137+
╭─ Options ────────────────────────────────────────────────────────────────────────────────────────╮
138+
│ --input -i PATH Path to the project root directory │
139+
│ (not required for --emit schema). │
140+
│ --output -o PATH Output directory for artifacts. │
141+
│ --format -f [json|msgpack] Output format for --emit json: │
142+
│ json or msgpack. │
143+
│ [default: json] │
144+
│ --emit [json|neo4j|schema] Output target: json │
145+
│ (analysis.json, default) | neo4j │
146+
│ (graph.cypher or live Bolt push) | │
147+
│ schema (the Neo4j schema.json │
148+
│ contract). │
149+
│ [default: json] │
150+
│ --app-name TEXT Logical application name for the │
151+
│ graph :PyApplication anchor │
152+
│ (default: input dir name). │
153+
│ --neo4j-uri TEXT Push the graph to a live Neo4j │
154+
│ over Bolt (incremental); omit to │
155+
│ write graph.cypher. │
156+
│ [env var: NEO4J_URI] │
157+
│ --neo4j-user TEXT Neo4j username. │
158+
│ [env var: NEO4J_USERNAME] │
159+
│ [default: neo4j] │
160+
│ --neo4j-password TEXT Neo4j password. Prefer the env var │
161+
│ over the flag (the flag is visible │
162+
│ in shell history / process list). │
163+
│ [env var: NEO4J_PASSWORD] │
164+
│ [default: neo4j] │
165+
│ --neo4j-database TEXT Neo4j database name (default: │
166+
│ server default). │
167+
│ [env var: NEO4J_DATABASE] │
168+
│ --codeql --no-codeql Enable CodeQL-based analysis. │
169+
│ [default: no-codeql] │
170+
│ --ray --no-ray Enable Ray for distributed │
171+
│ analysis. │
172+
│ [default: no-ray] │
173+
│ --eager --lazy Enable eager or lazy analysis. │
174+
│ Defaults to lazy. │
175+
│ [default: lazy] │
176+
│ --skip-tests --include-tests Skip test files in analysis. │
177+
│ [default: skip-tests] │
178+
│ --file-name PATH Analyze only the specified file │
179+
│ (relative to input directory). │
180+
│ --cache-dir -c PATH Directory to store analysis cache. │
181+
│ Defaults to '.codeanalyzer' in the │
182+
│ input directory. │
183+
│ --clear-cache --keep-cache Clear cache after analysis. By │
184+
│ default, cache is retained. │
185+
│ [default: keep-cache] │
186+
│ -v INTEGER Increase verbosity: -v, -vv, -vvv │
187+
│ [default: 0] │
188+
│ --help Show this message and exit. │
189+
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
232190
```
233191

234192
<!-- END canpy-help -->

scripts/update_readme.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,16 @@ def render_help() -> str:
3131
os.environ["TERM"] = "dumb"
3232
os.environ["NO_COLOR"] = "1"
3333

34+
# Typer caps help width at rich_utils.MAX_WIDTH (default 80) regardless of
35+
# COLUMNS, so CI renders the box narrower than a dev machine. Pin it to WIDTH
36+
# so the rendered help is wide and byte-identical everywhere.
37+
try:
38+
import typer.rich_utils as _ru
39+
40+
_ru.MAX_WIDTH = WIDTH
41+
except Exception: # pragma: no cover - defensive across Typer versions
42+
pass
43+
3444
from click.testing import CliRunner
3545
from typer.main import get_command
3646

0 commit comments

Comments
 (0)