
git 훅과 프로젝트 린트
개요
HK는 린터와 픽서를 병렬로 실행합니다. 읽기/쓰기 파일 락은 같은 파일에 스텝이 닿을 때 충돌을 방지해서, 실행 내 동시성이 정확성을 잃지 않습니다. 스톰프로 구성된 스텝은 락을 건너뛰고, 별도의 HK 프로세스도 락을 공유하지 않습니다. Git 훅, 터미널, CI에서 같은 단계를 사용하세요. Mise 설치를 한 후, 저장소 내에서 다음 명령어들을 실행하세요: HK init는 프로젝트 도구를 감지하고 HK.pkl을 생성합니다. 선택한 린터를 검토하고 실행 파일이 PATH에서 제공되는지 확인하세요; HK는 실행 방법을 설정하지만 설치는 하지 않습니다. hk init --interactive를 사용해 직접 도구를 선택하세요. Git 2.54+에서는 hk install --global을 한 번 실행해 저장소 간 hk를 활성화할 수 있습니다. 설치 후크는 hk 구성이 없는 프로젝트에서 조용히 종료됩니다. 구버전 Git 및 미즈 환경에 대한 설치 옵션을 참조하세요. 또한 브루 설치 hk나 화물 설치 hk ---락으로 HK를 설치할 수도 있습니다.
개요(AI 번역)
git 훅과 프로젝트 검사를 병행합니다.
HK는 린터와 픽서를 병렬로 실행합니다. 읽기/쓰기 파일 락은 같은 파일에 스텝이 닿을 때 두 자락이 충돌하지 않도록 해주므로, 실행 내 동시성이 정확성을 잃지 않습니다. stomp로 구성된 스텝은 락을 건너뛰고, 별도의 HK 프로세스는 락을 공유하지 않습니다. Git 훅, 터미널, CI에서 같은 단계를 사용하세요.
시작하기 · 문서 · 내장 인터 · CLI 참고문헌
퀵 스타트
Mise 설치를 한 후, 저장소 내에서 다음 명령어들을 실행하세요:
hk init는 프로젝트 도구를 감지하고 hk.pkl를 생성합니다. 선택한 린터를 검토하고 실행 파일이 PATH에서 사용 가능한지 확인하세요; HK는 실행 방법을 설정하지만 설치는 하지 않습니다. hk init --interactive를 사용해 직접 도구를 선택하세요.
Git 2.54+에서는 hk install --global를 한 번 실행하면 저장소 간 HK를 활성화할 수 있습니다. 설치 후크는 hk 설정이 없는 프로젝트에서 조용히 종료됩니다. 구버전 Git 및 미즈 환경에 대한 설치 옵션을 참조하세요.
HK는 brew install hk 또는 cargo install hk --locked로 설치할 수도 있습니다. 기본 Pkl 평가자는 hk에 내장되어 있으며; 별도의 Pkl 설치는 선택 사항입니다.
이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요.
README
원문 README의 일부입니다. 원문 보기.
hk
Git hooks and project checks, in parallel.
hk runs linters and fixers in parallel. Read/write file locks keep them from colliding when steps touch the same files, so concurrency within a run doesn’t cost you correctness. Steps configured with stomp skip the locks, and separate hk processes don’t share them. Use the same steps in Git hooks, from your terminal, and in CI.
Get started · Documentation · Built-in linters · CLI reference
Quick start
Install with mise, then run these commands inside your repository:
mise use hk
hk init
hk install
hk check --all
hk init detects project tools and generates hk.pkl. Review the selected linters and make sure their executables are available on PATH; hk configures how to run them, but does not install them. Use hk init --interactive to choose tools yourself.
On Git 2.54+, you can run hk install --global once to enable hk across repositories. Installed hooks exit silently in projects without an hk configuration. See installation options for older Git versions and mise environments.
You can also install hk with brew install hk or cargo install hk --locked. The default Pkl evaluator is built into hk; a separate Pkl installation is optional.
A configuration you can share
This example uses hk’s built-in whitespace utilities, so it needs no additional linter:
amends "package://github.com/jdx/hk/releases/download/v2.12.0/[email protected]#/Config.pkl"
import "package://github.com/jdx/hk/releases/download/v2.12.0/[email protected]#/Builtins.pkl"
steps {
["trailing-whitespace"] = Builtins.trailing_whitespace
["newlines"] = Builtins.newlines
}
Top-level steps is the recommended starting point: hk supplies check, fix, and pre-commit hooks using these steps. It is optional; you can also define steps only inside explicit hooks. See hook defaults.
Add tools such as Builtins.oxfmt, Builtins.eslint, or Builtins.ruff, or define your own steps.
Everyday commands
| Command | Use it to |
|---|---|
hk check |
Check modified files |
hk fix |
Apply available fixes to modified files |
hk check --all |
Check the repository, including in CI |
hk check --plan |
Preview selected files and steps without running them |
hk check --why oxfmt |
Explain why a step will run or be skipped |
추천 도구
다른 키워드를 입력하거나 필터를 제거해 보세요.
설치
npx skillfish add jdx/hk