Help us shape the future of Go! Take the 2026 Go Developer Survey

lintpal

module
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2026 License: MIT

README

lintpal

Test Lint Security Latest release npm version

Review committed code changes with questions you control. lintpal compares two Git revisions, asks a selected System One provider focused questions, and reports findings on changed lines. Rules are declarative YAML, so a team can keep review policy beside its code, pin imported rule packs, and revisit the same committed inputs.

lintpal is a CLI for review, not an auto-fixer. It reads committed Git objects; unsaved and uncommitted working-tree changes are outside the comparison.

Start in a few commands

Install the current public release through npm:

npm install -g lintpal
lintpal version

To use features from this source revision before they reach npm, build it with Go 1.26.6 or newer:

go build -o ./lintpal ./cmd/lintpal
./lintpal version

Choose a provider credential. For the default jev provider, set TYPESAFE_API_KEY in your environment or copy .env.example to .env and fill in the key. The local doctor check does not contact the provider:

./lintpal doctor --provider jev
mkdir -p .artifacts/lintpal
./lintpal lint --base HEAD~1 --head HEAD --provider jev \
  --format json --fail-on high --out .artifacts/lintpal/report.json

Both revisions must be available commits in the repository where you run lintpal. Use an absolute path to the built binary when reviewing another repository. The report is printed to stdout and written to the artifact path; exit code 10 means a finding met the gate after the complete report was written. See getting started for shallow clones, other providers, and error handling. See distribution for the published package layout and release status.

Make the review yours

A rule pairs a question with a decision threshold and fixed diagnostic text. For example, a noul rule can ask whether changed Go code drops a meaningful error:

schema: lintpal.rules.v1
rules:
  - id: go.unchecked-error
    type: noul
    instructions: Does the changed Go code discard an error whose failure should be handled?
    threshold: 0.95
    severity: high
    title: Possible unchecked error
    message: Review whether this error needs handling.
    paths: ['*.go']
    sides: [RIGHT]

The checked-in Go review pack also shows choice and score rules. The documentation review pack shows a focused Markdown rule. These are authoring examples, not claims of measured model accuracy. See rule authoring to write and calibrate rules.

Import a pack explicitly from a local directory, verify its lockfile, and select it for a review:

./lintpal pack import go-review ./examples/rules/go-review
./lintpal pack verify go-review
./lintpal lint --base HEAD~1 --head HEAD --rules @go-review

GitHub imports require an explicit ref. lintpal resolves it to a commit, stores a local copy, and records the exact content hash in .lintpal/packs.lock.json. Normal lint runs use the local copy offline; see rule packs for source syntax and updates.

Use it in development

Task runs routine checks from Taskfile.yml:

task --list
task check
task self-review-smoke

task check builds, tests, vets, checks formatting, evaluates the frozen offline corpus, and verifies docs and installed packs without a provider key. The test workflow keeps these checks credential-free on Linux, macOS, and Windows as appropriate. To review lintpal itself with a real provider, use explicit committed refs:

BASE=origin/main HEAD=HEAD task self-review

This opt-in command writes .artifacts/lintpal/self-review.json. Read the self-review guide for provider setup, rule selection, and gate behavior.

Documentation

Start at the documentation index, or jump to:

Use lintpal Extend and maintain it
Getting started · Configuration · CLI Rule authoring · Rule packs
Reports · Privacy and limits Development tasks · Self-review · Evaluation

When a remote provider is selected, lintpal sends bounded committed source context and rule questions to it. Review the privacy guide before running a live review. The current CLI does not inspect uncommitted changes, apply fixes, or report measured model precision. lintpal is available under the MIT license.

Directories

Path Synopsis
cmd
lintpal command
internal
apps/lintpal/contextplan
Package contextplan assembles bounded committed-source context and plans typed questions without invoking a provider.
Package contextplan assembles bounded committed-source context and plans typed questions without invoking a provider.
apps/lintpal/eval
Package eval evaluates frozen examples with typed, local answers.
Package eval evaluates frozen examples with typed, local answers.
apps/lintpal/git
Package git reads committed changes without consulting the working tree.
Package git reads committed changes without consulting the working tree.
apps/lintpal/jev
Package jev defines the typed decision boundary used by lintpal.
Package jev defines the typed decision boundary used by lintpal.
apps/lintpal/packs
Package packs installs and verifies project-local declarative rule packs.
Package packs installs and verifies project-local declarative rule packs.
apps/lintpal/provider/systemone
Package systemone implements the typed Jev System One HTTP transport.
Package systemone implements the typed Jev System One HTTP transport.
apps/lintpal/report
Package report defines the validated, deterministic lintpal.report.v1 artifact.
Package report defines the validated, deterministic lintpal.report.v1 artifact.
apps/lintpal/rules
Package rules loads declarative lint rules and maps typed Jev answers to deterministic decisions.
Package rules loads declarative lint rules and maps typed Jev answers to deterministic decisions.
apps/lintpal/runtime/adk
Package adk owns the optional, local ADK observability lifecycle.
Package adk owns the optional, local ADK observability lifecycle.
scripts
self-review command
Command self-review builds lintpal and reviews a committed comparison.
Command self-review builds lintpal and reviews a committed comparison.
verify-docs command
Command verify-docs checks local Markdown links and rule examples offline.
Command verify-docs checks local Markdown links and rule examples offline.
verify-format command
Command verify-format checks Go formatting without a platform-specific shell.
Command verify-format checks Go formatting without a platform-specific shell.
verify-packs command
Command verify-packs checks installed packs when this project has a lockfile.
Command verify-packs checks installed packs when this project has a lockfile.

Jump to

Keyboard shortcuts

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