Skip to content

Git hooks · linting · formatting

Your checks.
In parallel.
Before you commit.

hk runs your linters and formatters together, coordinating access to each file so fixes don’t overwrite one another.

mise use hk

Install with mise, or choose another installation method. All options →

hk.pklOne set of steps
local linters = new Mapping<String, Step> {
  ["prettier"] = Builtins.prettier
  ["eslint"] = Builtins.eslint
  ["ruff"] = Builtins.ruff
}

hooks {
  ["pre-commit"] {
    fix = true
    stash = "git"
    steps = linters
  }
  ["check"] { steps = linters }
}

Independent files, concurrent work

app.ts
checkfix
main.py
checkfix

Reads can overlap. Writes wait for access to the same file.

See the complete configuration

Keep your tools busy.

Read/write locks coordinate overlapping steps. Diff and file-list checks let hk narrow the work that needs an exclusive lock.

How execution works →

Keep partial commits useful.

Stash unstaged work before fixing the staged version of a file, then restore it after the hook finishes.

Understand stashing →

Bring the linters you use.

Start with built-in configurations or write a shell command. Use mise or your existing package manager to provide the tools.

Browse builtins →

From your editor to CI

A familiar command.
At every step.

Define your steps once in Pkl. Reuse them when you check a change, fix your working tree, or validate the whole repository.

Learn the workflow →
hk check
Check modified files
hk fix
Apply available fixes
hk check --all
Check the repository in CI
hk check --plan
Preview which steps will run
MIT LicenseCopyright © 2026jdx.dev