commentcensus

command
v2.4.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 3, 2026 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

commentcensus lists the multi-line comment blocks in the tree and measures what share of each package is comment.

It is a work list and a measurement, nothing else: it never edits a file and never says what a block should become. That judgment is the pass's, one block at a time, and a tool that guessed would be exactly the mechanical stripping that was considered and rejected (#1620).

What it will not put on the list, because those blocks are not prose: build and generate directives, lint pragmas, the cgo preamble that must sit against import "C", and a licence header. Listing them would send a reader to look at something they must not touch.

Usage:

go run ./hack/commentcensus              # per-package ratios, worst first
go run ./hack/commentcensus -blocks      # the work list, every block of 3+
go run ./hack/commentcensus -json        # the same numbers for a gate check
go run ./hack/commentcensus -pkg internal/storage/...
go run ./hack/commentcensus -dashes      # tracked lines holding an em dash

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL