Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 0 additions & 34 deletions .husky/pre-push

This file was deleted.

20 changes: 0 additions & 20 deletions .husky/task-runner.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,6 @@
"group": "pre-commit",
"command": "dotnet",
"args": ["csharpier", "check", "."]
},
{
"name": "build",
"group": "pre-push",
"command": "dotnet",
"args": ["build", "--nologo", "--verbosity", "minimal"]
},
{
"name": "test",
"group": "pre-push",
"command": "dotnet",
"args": [
"test",
"--no-build",
"--nologo",
"--verbosity",
"minimal",
"--filter",
"Category!=Integration"
]
}
]
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ dotnet build
dotnet test --filter "Category!=Integration"
```

Local hooks (CSharpier formatter check on commit, build + tests on push) install on first contributor run via `dotnet husky install`.
A local CSharpier formatter check on commit installs on first contributor run via `dotnet husky install`. Build and tests run in CI, not on push.

## License

Expand Down
4 changes: 2 additions & 2 deletions docs/CONTRIBUTING.jp.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ GitHub Flow(単一の `main`、短命の topic branch、squash-merge、Convent

## ローカル hooks

Husky.Net の pre-commit が CSharpier を実行、pre-push が `dotnet build` + `dotnet test --filter "Category!=Integration"` を実行 — [ADR 0025](adr/0025-dev-automation-hooks.md) を参照。
Husky.Net の pre-commit が CSharpier を実行します。build とテストは push 時には走らせず CI(`pr.yml`)の担当 — [ADR 0025](adr/0025-dev-automation-hooks.md) を参照。

## CI ゲーティング

Expand All @@ -41,7 +41,7 @@ Clean Architecture + DDD + handler レベル CQRS([ADR 0003](adr/0003-architec

xUnit + Shouldly + Testably.Abstractions。テストは `src/` を 1:1 でミラー (`IviCli.<Layer>.Tests`)。挙動変更には TDD(Red → Green → Refactor)を採用してください。

Integration テストは `[Trait("Category", "Integration")]` を付与し、pre-push hook と PR ビルドでは既定で skip され、`nightly.yml` で実行されます。
Integration テストは `[Trait("Category", "Integration")]` を付与し、PR ビルドでは既定で skip され、`nightly.yml` で実行されます。

## ADR

Expand Down
4 changes: 2 additions & 2 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ GitHub Flow (single `main`, short-lived topic branches, squash-merge, Convention

## Local hooks

Husky.Net pre-commit runs CSharpier; pre-push runs `dotnet build` + `dotnet test --filter "Category!=Integration"` — see [ADR 0025](adr/0025-dev-automation-hooks.md).
Husky.Net pre-commit runs CSharpier. Build and tests are not run on push — that is CI's job (`pr.yml`) — see [ADR 0025](adr/0025-dev-automation-hooks.md).

## CI gating

Expand All @@ -41,7 +41,7 @@ Clean Architecture + DDD + handler-level CQRS (see [ADR 0003](adr/0003-architect

xUnit + Shouldly + Testably.Abstractions. Tests mirror `src/` 1:1 (`IviCli.<Layer>.Tests`). TDD (Red → Green → Refactor) is expected for behavioural changes.

Integration tests carry `[Trait("Category", "Integration")]`; they are skipped by default in the pre-push hook and PR build, and run on `nightly.yml`.
Integration tests carry `[Trait("Category", "Integration")]`; they are skipped by default in the PR build, and run on `nightly.yml`.

## ADRs

Expand Down
2 changes: 1 addition & 1 deletion docs/README.jp.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ dotnet build
dotnet test --filter "Category!=Integration"
```

ローカル hooks (commit 時 CSharpier formatter チェック、push 時 build + tests) は初回 `dotnet husky install` で導入されます。
ローカルの CSharpier formatter チェック (commit 時) は初回 `dotnet husky install` で導入されます。build とテストは push 時ではなく CI で実行されます

## ライセンス

Expand Down
28 changes: 11 additions & 17 deletions docs/adr/0025-dev-automation-hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,18 @@ Rationale:
- CSharpier's output is deterministic across machines, so violations are unambiguous.
- pre-commit must stay fast (sub-second). Format check qualifies; tests do not.

### 4. pre-push: build + unit/architecture tests
### 4. pre-push: no build or tests (CI owns them)

Run **`dotnet build`** followed by **`dotnet test --filter "Category!=Integration"`** on push. If either fails, the push is rejected.
Pre-push runs nothing. Build and `dotnet test --filter "Category!=Integration"` run in CI (`pr.yml`) on every PR, in a clean environment with `--locked-mode`. There is no `.husky/pre-push` hook.

Rationale:

- Squash merge means individual commit greenness does not survive to `main`, so blocking every commit with tests fights TDD's Red phase commits unnecessarily.
- Pre-push is the latest local moment to catch broken code before it touches the remote.
- Integration tests are excluded (per ADR 0009) — they belong in nightly / manual CI runs.
- The pre-push build + test duplicated the PR CI gate while diverging from it: a local run has no `--locked-mode` and a different SDK / OS, so a local pass did not imply a CI pass and a local failure was sometimes environmental. CI is the authoritative build / test gate.
- It added minutes of latency to every non-docs push, and — bypassable with `--no-verify` — was never a hard gate anyway.
- Keeping it usable had required a docs-only skip script that re-implemented CI's changed-files logic locally; a second copy that could drift. Removing the tests removes the need for the skip.
- Squash merge means individual commit greenness does not survive to `main`, so there is little value in blocking each local push on the full suite.

The original decision ran `dotnet build` + `dotnet test` on push; it is superseded here.

### 5. Claude Code PostToolUse hook: auto-format edited C# files

Expand All @@ -88,11 +91,9 @@ No local `commit-msg` hook is configured.
- CONTRIBUTING (when written) will reiterate this norm.
- The CI checks on the server side enforce the same rules regardless of local bypass.

### 8. File-type filtering: deferred

A `staged-file-type` filter (skipping format/test when only docs are changed, etc.) is **not** introduced in Phase 1. Test runs are expected to be sub-second for the foreseeable future, so the simplicity of unconditional execution is preferred.
### 8. File-type filtering: not needed

If pre-push run time exceeds a few seconds on a routine basis, this decision is revisited.
No `staged-file-type` filter is required. The only local hook is the pre-commit CSharpier check, which inspects C# and is a no-op on docs-only changes. (An earlier revision briefly ran tests on push behind a docs-only skip script; §4 removed both.)

### 9. Branch-aware policy: not adopted

Expand All @@ -112,14 +113,7 @@ dotnet tool restore >/dev/null
dotnet husky run --group pre-commit
```

`.husky/pre-push`:

```sh
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
dotnet tool restore >/dev/null
dotnet husky run --group pre-push
```
There is no `.husky/pre-push` (§4).

`.claude/settings.json` (PostToolUse hook for CSharpier):

Expand Down