Git Clients

hk – Git hooks manager and project linting tool

hk is a Git hooks manager and project linting tool written in Rust. It helps developers automate code-quality checks and formatting tasks, both when committing changes and during ordinary development.

The application is particularly useful for projects that use several linters and formatters. Running these tools sequentially can be unnecessarily slow, while running them all at once risks conflicts when multiple tools modify the same files. hk addresses this through coordinated task execution.

Its configuration can be shared across a development team, allowing the same checks to run locally and in continuous integration environments. The aim is to catch problems early without turning every commit into a lengthy exercise.

This is free and open source software.

Key Features

  • Runs linters, formatters and other project checks concurrently, using read/write file locks to prevent conflicting modifications.
  • Uses Pkl for configuration, with support for typed settings, imports and reusable definitions.
  • Provides built-in configurations for popular development tools, including Prettier, ESLint, Ruff, Black and other linters and formatters.
  • Can detect available project tools and generate an initial configuration with the hk init command.
  • Separates checking from fixing: hk check reports problems without modifying files, while hk fix applies available corrections.
  • Supports checks against modified files or the entire repository, with options to preview planned operations and explain why particular steps are selected.
  • Temporarily stashes unstaged changes during pre-commit operations, protecting partially staged files from unintended modifications.
  • Supports automatic staging of corrected files during hooks, with explicit control over staging during manual fixes.
  • Filters files by patterns and types, and supports dependencies between individual processing steps.
  • Can produce structured diagnostics, including SARIF output for integration with code-quality reporting systems.
  • Integrates with mise for managing development toolchains and executing project commands.

Website: github.com/jdx/hk
Support:
Developer: Jeff Dickey
License: MIT License

hk

hk is written in Rust. Learn Rust with our recommended free books and free tutorials.


Related Software

Git Hook Managers
lefthookGit hooks manager for Node.js, Ruby, Python and more
huskyGit hooks made easy
pre-commitManage and maintain multi-language pre-commit hooks
GrumPHPAutomates PHP code quality checks through configurable Git hooks
prekReimagined version of pre-commit
overcommitManage and configure Git hooks
hkGit hooks manager and project linting tool focusing on performance
simple-git-hooksSimple git hooks manager for small projects
CaptainHookFlexible Git hook manager
GithooksPlatform-independent hooks manager
git-hooksRewritten from icefox/git-hooks, with extra features
AutohookRuns and organises Git hook scripts using a single Bash script
JigGit pre-commit hook on steroids

Read our verdict in the software roundup.


Best Free and Open Source Software LinuxLinks helps you discover the best free and open source software for Linux. Explore our extensive collection of recommended applications, including alternatives to popular proprietary software.

We also publish software reviews, Linux tutorials, hardware reviews, free programming books and articles covering the wider open source community. Browse our Linux resources to discover more.

Know a useful free and open source Linux application we haven't covered? Suggest a program for inclusion.

Has your software been featured on LinuxLinks? Display one of our Featured on LinuxLinks badges on your website or GitHub README.
Subscribe

Please read our Comment Policy before commenting.

Notify of
guest
0 Comments
Oldest
Newest Most Voted