-
Notifications
You must be signed in to change notification settings - Fork 0
Getting Started
About a minute, from nothing to a rule catching something.
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 anywhereOr download from the releases page.
Nothing is pulled in as a dependency any of these ways. The binary carries its own JavaScript engine.
lanekeep initIt 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 |
lanekeep checkinternal/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
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/**.
- 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 ruleslists what the project has configured. - Turn on more built-ins from Configuration.
- Write your own: Writing Rules.
| 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.
Languages
In the repository