Migrate git hooks scripts from Bash to Rust
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
調査の方向性
Start with the three scripts named in the issue: contrib/dev-tools/git/hooks/pre-commit.sh, contrib/dev-tools/git/hooks/pre-push.sh, and contrib/dev-tools/git/install-git-hooks.sh, then read the full implementation spec under docs/issues/open/ and the referenced CLI output contract ADR. Compare the current checks and installation behavior with the Phase 1 requirements; done means the Rust binary replaces the scripts and complies with the stated NDJSON-on-stderr and exit-code contract, with Phase 2 enhancements treated separately.
索引モデルが issue の本文から書いたものです。
説明
Goal
Replace the three Bash scripts that implement pre-commit checks, pre-push checks, and git hook installation with a single Rust binary that improves testability, type safety, and maintainability, and that adds real-time feedback during long-running checks so developers and automation agents can see hook progress without cancelling valid runs.
Scripts to replace
| Script | Purpose |
|---|---|
contrib/dev-tools/git/hooks/pre-commit.sh |
Runs fast quality checks (cargo machete --with-metadata, linter, doc tests) |
contrib/dev-tools/git/hooks/pre-push.sh |
Runs comprehensive checks (machete, linters, nightly build, tests, E2E) |
contrib/dev-tools/git/install-git-hooks.sh |
Installs hooks from .githooks/ to .git/hooks/ |
Motivation
The scripts have grown beyond simple orchestration (engineering policy #3 in AGENTS.md). They now implement structured argument parsing, a multi-step runner with timing and log management, and two output modes — logic that is duplicated across both scripts. This also creates feedback UX and redundant-execution problems:
- Hooks appear hung during long checks (pre-push takes ~15 min); no intermediate progress is visible.
- If only Markdown files are staged, the full Rust suite still runs unnecessarily.
- Hooks re-run even when they already passed for the same set of changes.
Implementation plan (two phases)
Phase 1 — Core migration: implement the same steps as the current scripts using NDJSON output (no --format=text|json switch), switch over, and remove the Bash scripts.
Phase 2 — Enhancements: heartbeat events for long steps, smart step skipping for docs-only commits, and idempotency cache to skip hooks that already passed for the same changes.
Full spec
See docs/issues/open/ for the complete implementation spec once the spec-only PR is merged.
Compliance
The new binary must comply with the global CLI output contract ADR (docs/adrs/20260519000000_define_global_cli_output_contract.md) from day one: no-stdout-result class, NDJSON on stderr, exit codes 0/1/2.
- 主要言語
- Rust
- スター
- 532
- フォーク
- 56
- 平均マージ
- 11時間 20分
- マージ済み PR(30日)
- 282
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
torrust/torrust-tracker のほかの issue
-
Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
torrust/torrust-tracker#3080 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
torrust/torrust-tracker#3069 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
torrust/torrust-tracker#3058 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
torrust/torrust-tracker#2978 ·
メンテナーはふだん 1 日以内に返信
-
Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
torrust/torrust-tracker#2332 ·
メンテナーはふだん 1 日以内に返信
torrust/torrust-tracker の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
メンテナーはふだん 1 日以内に返信
-
marketing
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
difficulty: easy docs help wanted tooling
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
-
bug help wanted ui
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
userFRM/egui-charts#4386 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
eliasstravik/herdr-projects#1605 · コメント 1 件 ·