Skip to content

Add two new analyzers: pure and lean - #45

Merged
nnutter merged 3 commits into
masterfrom
quality
Nov 13, 2026
Merged

nnutter merged 3 commits into
masterfrom
quality

Conversation

@nnutter

@nnutter nnutter commented Nov 13, 2026

Copy link
Copy Markdown
Owner

No description provided.

Change-Id: I95ae26ae8f7c96ccc4c86ed662d871676172aace
New opt-in `//constable:pure` contract: a pure function has no
observable effect beyond its return values. It forbids caller-visible
mutation, package-global writes, goroutine spawns, and calls that read
the clock, randomness, environment, or perform I/O. Pure functions stay
deterministic given their arguments, so they are safe to reorder,
parallelize, or test without flaky setup.

Change-Id: I9bb748ff549a95d6d4b0de027d1b27ac47a90ffa
Reports unused unexported functions, types, variables, and constants,
keeping packages small so less context stays in mind. The check stays
precise: methods, struct fields, unused parameters, exported symbols,
and `iota`-sensitive constant groups are never reported. `-fix` deletes
each reported declaration, including its doc, and removes imports that
only the deleted code used.

Change-Id: I5cfb5dee4083d8347b84b70548dcdd2e0474bf56
@nnutter
nnutter merged commit 09767c5 into master Nov 13, 2026
3 checks passed
@nnutter
nnutter deleted the quality branch November 13, 2026 02:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant