Repository navigation
Commit 0b1e50e
authored
Document the case-sensitive KtLint hook name (#927)
The configuration in #787 uses `Ktlint`, while the built-in hook is
named `KtLint`. With `required_executable: ktlint`, the misspelled name
becomes an ad hoc hook. It receives Git's original hook arguments, so a
pre-commit invocation runs Ktlint with no filenames and scans unmodified
files too.
Document the exact built-in name, give a minimal working configuration,
and explain why the alternative spelling behaves differently. Strengthen
the existing KtLint success example to require passing the applicable
filenames to the executable.
Fixes #787 through a configuration correction; no runtime change is
necessary.
Local reproduction with Ktlint 1.8.0 downloaded into `/tmp` and a
disposable Git repository:
- Commit an invalid `Bad.kt`, then stage only a valid `Good.kt` and
Overcommit configuration.
- With the report's `Ktlint` spelling, a real commit fails and reports
the unchanged `Bad.kt`.
- Change only the hook name to `KtLint`: the real commit succeeds and
does not report `Bad.kt`.
Validation: existing KtLint specs pass with the stronger argument
assertion; RuboCop passes. Full CI is required before merging.
Final verification: [run
42762226697](https://github.com/sds/overcommit/actions/runs/42762226697)
passed all 38 checks, including Linux/Windows Ruby 3.3, 3.4, and 4.0,
lint, CI, and all coverage statuses. All 20 completed jobs report zero
annotations.1 parent 6647ccc commit 0b1e50e
2 files changed
Lines changed: 16 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
396 | 396 | | |
397 | 397 | | |
398 | 398 | | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
399 | 413 | | |
400 | 414 | | |
401 | 415 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
0 commit comments