Skip to content

Getting Started

Fred Souza edited this page Aug 3, 2026 · 1 revision

About a minute, from nothing to a rule catching something.

1. Install

Whichever fits the project you are adding it to. They all deliver the same binary.

npm install --save-dev lanekeep                          # Node
pip install lanekeep                                     # Python
go get -tool github.com/fmsouza/lanekeep/cmd/lanekeep    # Go
brew install fmsouza/tap/lanekeep                        # macOS / Linux, system-wide
cargo install lanekeep-cli                               # Rust, or from source anywhere

Or download from the releases page.

Nothing is pulled in as a dependency any of these ways. The binary carries its own JavaScript engine.

2. Scaffold

lanekeep init

It looks for go.mod, pyproject.toml, package.json and friends, then writes a config and a starter rule matched to what it found:

lanekeep.json                 # what to check, and with which rules
lanekeep/rules/<starter>.ts   # a worked example you can edit
Project Starter rule Built-in enabled
Go local/no-fmt-println lanekeep/no-package-init
Python local/no-print lanekeep/no-broad-except
TypeScript local/no-debugger lanekeep/no-default-export

3. Check

lanekeep check
internal/store.go:12:2 error [lanekeep/no-package-init] `init` runs at import time in an order nothing states
  → move the work into an explicit constructor or a call from main, so the order it happens in is written down

✖ 1 error(s) across 1 file(s) checked

If it says 0 file(s) checked

Nothing matched include. That is the one thing everybody hits first. Open lanekeep.json and widen the glob to wherever your code actually lives — the scaffold guesses, and for a TypeScript project it guesses src/**.

4. Then what

  • Read the starter rule. It is short, commented, and the fastest way to understand the shape.
  • lanekeep explain <rule-id> prints any rule's card without opening its source.
  • lanekeep rules lists what the project has configured.
  • Turn on more built-ins from Configuration.
  • Write your own: Writing Rules.

Exit codes

Code Meaning
0 Clean
1 Violations found
2 The checker could not run

A caller has to be able to tell "your code has problems" from "the tool is broken", which is why those are three codes and not two. --warn-only reports violations but exits 0, for a phased rollout.

Clone this wiki locally