Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

hook-manager: register managers that need no install fix (simple-git-hooks, cargo-husky, Maven plugins)

Aperta
#1,825 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
38/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
git, java, javascript, python, rust

Direzione di ricerca

Start with the hook-manager contract in tools/hook-manager/README.md, then inspect tools/dev/sync-hook-managers.py and its registry. Check the linked-worktree behavior and generated Maven hook scripts, then confirm each manager by installing it and making a commit that runs its hook. Done means the registry, adapter table, and docs/setup/secure-agent-setup.md cover the confirmed managers and caveats, with the stated checks passing.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

contract:hook-manager family:setup good first issue

The hook-manager contract (#1819) defines how the secure agent setup integrates a git-hook manager: where its install puts the hook, how its home is split between sandboxed and host runs, and how the setup detects that a repository uses it.
Several managers already install into the repository's own hooks dir whatever the global core.hooksPath says, so they need no install fix, only a registry entry (install.strategy: none, which the contract lists as planned) and documentation.
This issue covers them.

What the source says

  • simple-git-hooks 2.14.0 (JavaScript). Reads only git config --local core.hooksPath, else <common dir>/hooks, with worktree commondir resolution (simple-git-hooks.js:60-96, 246-266). It ignores the global value, so it already lands where the dispatcher chains.
    Runs from the package postinstall. It overwrites an existing hook without a backup (:292-303). Skip install: SKIP_INSTALL_SIMPLE_GIT_HOOKS; skip hooks: SKIP_SIMPLE_GIT_HOOKS=1. No home. Config: a simple-git-hooks key in package.json, or .simple-git-hooks.{js,cjs,json} / simple-git-hooks.{js,cjs,json} (confirm the list).
  • cargo-husky v1.0.1 (Rust). A build.rs in a dev-dependency walks up from OUT_DIR to .git and writes <gitdir>/hooks (build.rs:49-73, 154-164), ignoring core.hooksPath.
    It does not handle a .git file, so it fails with GitDirNotFound in a linked worktree, and a CARGO_TARGET_DIR outside the repository breaks it too. Never touches a foreign hook. No home of its own.
  • Maven: git-build-hook 3.6.0 and git-code-format-maven-plugin 1.25 (Java). Both write JGit's getGitDir()/hooks and ignore core.hooksPath.
    git-build-hook's configure goal can write any repository config key (GitConfigMojo.java), core.hooksPath included, which bypasses the dispatcher the same way husky does.
    Not yet checked: JGit's behaviour in a linked worktree, and the generated hook scripts.
  • Not yet researched: Gradle hook plugins, and Go hook tools other than lefthook.

What to do

  1. Implement install.strategy: none in tools/dev/sync-hook-managers.py (no shim case; the install skill installs no shim for it).
  2. Add registry entries for simple-git-hooks, cargo-husky and the two Maven plugins, with their detection rules, and run tools/dev/sync-hook-managers.py.
  3. Check the open points above (JGit in a worktree, the Maven hook scripts), and add Gradle plugins and Go tools if any need an adapter.
  4. Document the cargo-husky worktree limitation and the git-build-hook configure caveat in the contract's adapter table and in docs/setup/secure-agent-setup.md.

Acceptance

  • Each manager's behaviour under the whole-user dispatcher is confirmed by running it once (install, then a commit that runs its hook), and recorded in the contract.
  • prek run --all-files --skip workspace-pytest and the dev tests pass.
Lingua principale
Python
Stelle
124
Fork
114
Merge medio
15h 48m
PR unite (30g)
370

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di apache/magpie

Tutte le issue di apache/magpie

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.