Skip to main content

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.

What it finds

This pwndbg comment was written in 2018, above a check for a missing Pygments. A 2022 cleanup commit replaced that check with a plain import, and the comment stayed. Comment Lens reads both dates from git blame and reports the comment with the evidence.

Lines 87 to 94 of pwndbg/color/syntax_highlight.py with each line's blame date. The comment on line 88 is dated 2018-01-12 and is highlighted. The line below it, dated 2022-10-08, is marked as changed. A finding box lists both commits.

Features

  • Parsing: Tree-sitter grammars, with a Pygments fallback, separate docstrings, line comments, inline notes and header blocks.
  • Maintenance signals: flags unresolved TODO, FIXME and HACK comments, comments that repeat a symbol name, comments near changed code, and broken local file links.
  • Git checks: --changed limits 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

Adopt it with a baseline

Record the current findings once, then let only new findings fail a build:

comment-lens baseline create . --output .comment-lens-baseline.json
comment-lens compare . --baseline .comment-lens-baseline.json --fail-on high

See CI checks and baselines for the pre-commit hook and the GitHub Actions workflow.

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.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for comment-lens-scanner 0.1.2
File Size Uploaded Provenance Actions
comment_lens_scanner-0.1.2.tar.gz 36.2 kB With provenance Details for comment_lens_scanner-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for comment-lens-scanner 0.1.2
File Interpreter ABI Platform Actions
comment_lens_scanner-0.1.2-py3-none-any.whl Python 3 none any Details for comment_lens_scanner-0.1.2-py3-none-any.whl

Total release size: 66.9 kB

Release files / comment_lens_scanner-0.1.2.tar.gz

Download URL comment_lens_scanner-0.1.2.tar.gz
Size 36.2 kB
Tags Source
SHA-256 checksum
How to use checksums
bbfeecf2302fb76372442f9f7c0bd1b4659450aed5d7183e1e6cbea8fa31d536
BLAKE2b-256 checksum
How to use checksums
f88675ab6fed5f573dcf369f8b09e1c8fb4348bb45e96c5639d45dffeb87aed5
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 24, 2026.

Transparency log

Release files / comment_lens_scanner-0.1.2-py3-none-any.whl

Download URL comment_lens_scanner-0.1.2-py3-none-any.whl
Size 30.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fa89cb43164bda1663a29825f14a82c67afba2a2e55c7bc18e5ef26ea2303d88
BLAKE2b-256 checksum
How to use checksums
8f057f618410324c6af23ac159af354b34a7bc920882b9232f9b802ecfae5480
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 24, 2026.

Transparency log

Security for comment-lens-scanner 0.1.2

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.

Select from 2 files

Attestation for comment_lens_scanner-0.1.2.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 24, 2026.

Transparency log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page