• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

sgerrand / git_hoox / 31589465432
98%

Build:
DEFAULT BRANCH: main
Ran 12 Aug 2026 10:54AM UTC
Jobs 1
Files 28
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

12 Aug 2026 10:54AM UTC coverage: 98.131% (-0.2%) from 98.315%
31589465432

push

github

web-flow
refactor: simplify hooks, config, installer and doctor (#23)

* refactor(hooks): centralise command execution in Helpers

Every built-in hook hand-threaded `env: Helpers.env_opt(opts)` into
Cmd.run/3, and Test.exec/2 and Mix.exec/2 were byte-identical private
functions. Add Helpers.cmd/3 and Helpers.mix/2 so `:env` has a single
enforcement point, matching its three global siblings (`:files`,
`:timeout`, `:stage_fixed`), which the runner already enforces
centrally.

The `:args` NimbleOptions entry was copy-pasted into five hook
schemas with only the doc string differing; it now comes from
Helpers.args_schema/1.

Also drops two single-use resolver wrappers in Shell in favour of
direct captures, and swaps Test's two prefix/suffix regexes for
String.replace_prefix/3 and String.replace_suffix/3.

* perf(format): skip the worktree diff on check_only runs

`mix format --check-formatted` never writes, so the follow-up
`git diff --name-only` looking for files to re-stage could not find
anything the hook had modified. Return a bare `:ok` in that case and
save one git subprocess per commit.

This also stops a check_only run from re-staging unrelated unstaged
edits, which the previous `{:ok, changed}` return did whenever the
default `stage_fixed: true` was left in place.

While here, adopt Helpers.cmd/3 and Helpers.args_schema/1, and build
the argument list from a flag list instead of branching over the
whole list. Argument order is unchanged.

* refactor(installer): derive hook filenames from the stage list

The eight git stages were written out twice — as snake_case atoms in
Config.Schema and again as kebab-case strings in Installer — and the
atom-to-filename transform a third time, inline in the run task's
error message. Forgetting the Installer list meant no shim was
written, with nothing to catch it.

Add Schema.hook_filename/1 and Schema.hook_filenames/0 beside
parse_stage/1, and build Installer's list and the run task's message
from them. Schema.valid_stag... (continued)

74 of 75 new or added lines in 14 files covered. (98.67%)

630 of 642 relevant lines covered (98.13%)

28.7 hits per line

Uncovered Changes

Lines Coverage ∆ File
1
87.5
-12.5% lib/git_hoox/hooks/helpers.ex
Jobs
ID Job ID Ran Files Coverage
1 31589465432.1 12 Aug 2026 10:54AM UTC 28
98.13
GitHub Action Run
Source Files on build 31589465432
  • Tree
  • List 28
  • Changed 17
  • Source Changed 17
  • Coverage Changed 17
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #31589465432
  • f202a111 on github
  • Prev Build on main (#31574112157)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc