Comment Lens Scanner
Comment Lens extracts code comments for review. The local command-line interface flags comments that may need attention, explains each finding with deterministic rule evidence, and leaves repository files unchanged.
Features
- Parsing: Tree-sitter grammars, with a Pygments fallback, separate docstrings, line comments, inline notes and header blocks.
- Maintenance signals: flags unresolved
TODO,FIXMEandHACKcomments, comments that repeat a symbol name, comments near changed code, and broken local file links. - Git checks:
--changedlimits a pre-commit or CI check to comments added or modified on the current branch. - Export: JSON, NDJSON, Markdown and SARIF, which GitHub Actions can turn into pull request annotations.
- Local by default: reads code without executing it and sends nothing to external servers.
Installation
Install the scanner from PyPI. It needs Python 3.12 or newer.
python3 -m pip install comment-lens-scanner
To run the code in a checkout of the repository instead, use python3 -m pip install ./scanner from the repository root.
Usage
Scan a repository
Scan the current repository and generate local finding manifests (.comment-lens/scan.json and .comment-lens/comments.ndjson):
comment-lens scan .
Check changed comments
Check only comments on lines changed between origin/main and HEAD. The command exits 1 if a high-severity finding is introduced:
comment-lens check . --changed origin/main...HEAD --fail-on high
Generate SARIF output for CI integration:
comment-lens check . --changed HEAD --scope files --format sarif --output findings.sarif
Export an existing scan
Convert an existing scan artifact into Markdown or JSON:
comment-lens export . --format markdown
comment-lens export . --format json
Configuration
Place a .comment-lens.toml file at your repository root to configure exclusions and rule policies:
version = 1
exclude = ["fixtures", "legacy"]
[policy]
fail_on = "none"
[policy.rules]
todo = "review"
fixme = "high"
restates_symbol = "review"
missing_local_reference = "high"
License
MIT License. See LICENSE for details.
Metadata
Release files for comment-lens-scanner 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| comment_lens_scanner-0.1.1.tar.gz | 34.9 kB | With provenance | Details for comment_lens_scanner-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| comment_lens_scanner-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for comment_lens_scanner-0.1.1-py3-none-any.whl |
Total release size: 64.9 kB
Release files / comment_lens_scanner-0.1.1.tar.gz
| Download URL | comment_lens_scanner-0.1.1.tar.gz |
|---|---|
| Size | 34.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0f173fa0e89a6faf767dd1658cd1b659cd6736f615214211bfe08cc72591109d
|
|
BLAKE2b-256 checksum How to use checksums |
0b4d181cdbd17debf68bbd16e8371593604ae34486495d082f2a06595bd51fd4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Transparency logRelease files / comment_lens_scanner-0.1.1-py3-none-any.whl
| Download URL | comment_lens_scanner-0.1.1-py3-none-any.whl |
|---|---|
| Size | 30.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a4a843705550e559736105816ac18b2c9de634a793d0f8528202b20649e897fe
|
|
BLAKE2b-256 checksum How to use checksums |
bd3e539cc259f83eb6d84a11eb2b6a656199b4f2ffb2c3a9f4951c4221c2ee01
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Transparency logSecurity for comment-lens-scanner 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for comment_lens_scanner-0.1.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.