Skip to the cargo
Avast! Back to plain English →

Git hooks fer linters and formatters

All hands haul at once

Chart yer checks once, and hk pipes the crew on deck afore ye set sail, while ye work, or fer the harbour-master in CI. Independent hands haul side by side, and a lock on each shared file takes the strain.

mise use hk

mise, the quartermaster, brings hk aboard, though there be other ways. Every way aboard →

hk.pklThe charts we sail by
// Run by check, fix, and pre-commit
steps {
  ["prettier"] = Builtins.prettier
  ["eslint"] = Builtins.eslint
  ["ruff"] = Builtins.ruff
}

Side by side, each on a file o' their own

app.ts
checkfix
main.py
checkfix

Each file has its own lane, and all hands haul at once. Checks can share a file; a fix makes its file fast until the mending's done.

Unroll the charts in full

The voyage o' every commit

What the crew does on every run o' the pre-commit hook, verse by verse.

  1. git commit

    Ye christen her, hit return, and she makes ready to sail.

  2. All hands on deck

    The pre-commit hook pipes the crew up from stem to stern.

  3. Snug in the hold

    hk can stow the cargo left on the dock in the hold, so the crew sees only the cargo loaded aboard.

  4. All hands haul at once

    Lookouts and sailmakers work in parallel, and a lock on each file takes the strain.

  5. Bound for the main

    The fixes are loaded aboard, yer stowed cargo comes up from the hold, and she sets sail. A squall no sailmaker can mend hauls her back to port.

Turn up the sound, matey: the words be on screen, so ye can sing along.

Sing along, matey

Bound for the Main

The hk sea shanty: one commit's voyage through hk, sung by the whole crew.

Heave away, haul away, hk! (Heave ho!)All hands haul at once! (Haul away!)For a lock on each file takes the strain,And we're bound away for the main!

Side by side, made fast

Independent hands haul at once, even over shared cargo: read/write locks make each file fast, so no two collide. Where a tool can call out a patch or a list o' files, hk narrows the work that needs a file to itself.

How the crew hauls →

Snug in the hold

hk stows the cargo left on the dock in the hold afore it mends the staged version o' a file, then brings it up from the hold when the hook is done.

How the stowin' works →

The standing crew

Sign on a builtin from the standing crew, or a hand of yer own with a shell command. mise, the quartermaster, or yer usual package manager provisions the tools.

Read the crew roster →

They steer by the one set of charts

One set o' charts, from the helm to the harbour-master

Sign on yer hands once, in Pkl. The hook, the helm and the harbour-master all muster the self-same crew: to inspect a change, mend yer working tree, or inspect the whole ship.

Learn the ropes →
hk check
Who'll check the cargo?
Inspects the cargo ye've changed
hk fix
Who'll mend the canvas?
Makes every mend the crew knows how
hk check --all
Who'll haul the halyard?
The whole o' the cargo, fer the harbour-master
hk check --plan
And where are we bound?
The passage plan: which hands will be called

So all you hands who would sign aboard,

There's but three words left to say

mise use hk

And we're bound away for the main!

Get under way
MIT LicenseCopyright © 2026jdx.dev