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

sds / overcommit / 41935456288
92%
master: 91%

Build:
Build:
LAST BUILD BRANCH: main
DEFAULT BRANCH: master
Ran 04 Nov 2026 11:41PM UTC
Jobs 8
Files 223
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

04 Nov 2026 11:39PM UTC coverage: 92.031%. Remained the same
41935456288

push

github

web-flow
Read .overcommit.yml as UTF-8 in the hook template (#910)

Fixes #868.

Every hook in `template-dir/hooks` starts by reading `.overcommit.yml`
to look for a `gemfile:` setting:

```ruby
File.read('.overcommit.yml') =~ /gemfile: (?:false|['"]?(.*)['"]?)/
```

`File.read` without an encoding uses `Encoding.default_external`. Under
a non-UTF-8 locale such as `LANG=C` that is US-ASCII, so if
`.overcommit.yml` contains any non-ASCII character (even in a comment)
the match raises `ArgumentError: invalid byte sequence in US-ASCII`
before Overcommit loads, and every git hook fails.

This passes `encoding: 'UTF-8'` in all 10 hook copies (the template
directory spec requires them to be byte-identical).

The regression spec in `spec/integration/template_dir_spec.rb`
initializes a temporary repository using the hook templates and writes a
`.overcommit.yml` containing a non-ASCII comment. It runs the installed
`pre-commit` hook with `LC_ALL=C LANG=C` and `-E US-ASCII`, then checks
for a successful exit and output from the configured `AuthorName` check.
This verifies that the hook actually runs instead of passing on an
unrelated startup failure or an early exit. The encoding is set
explicitly because the CI runners use a UTF-8 locale by default.

Initial validation of the original spec on the fork:

- Spec only, without the fix:
[Tests](https://github.com/ChandraChaan/overcommit/actions/runs/41726596528)
fails on every Ruby from 2.6 to 4.0 with a single failure out of 1667
examples, `template_dir_spec.rb:31`, `expected
"…/template-dir/hooks/pre-commit:30:in '<main>': invalid byte s…" not to
include "invalid byte sequence"`.
- Spec with the fix:
[Tests](https://github.com/ChandraChaan/overcommit/actions/runs/41726604340)
passes on all eight Ruby versions (`1667 examples, 0 failures`), and
Lint passes.

The original fix commit is the squashed form of the fix branch; a
separate follow-up commit strengthens the regression test. I left
`CHANGELOG.md` alone since it look... (continued)

3326 of 3614 relevant lines covered (92.03%)

3269.75 hits per line

Jobs
ID Job ID Ran Files Coverage
1 ruby3.2-ubuntu - 41935456288.1 04 Nov 2026 11:41PM UTC 446
91.94
GitHub Action Run
2 ruby3.0-ubuntu - 41935456288.2 04 Nov 2026 11:41PM UTC 446
91.97
GitHub Action Run
3 ruby3.1-ubuntu - 41935456288.3 04 Nov 2026 11:41PM UTC 446
91.94
GitHub Action Run
4 ruby3.3-ubuntu - 41935456288.4 04 Nov 2026 11:41PM UTC 446
91.99
GitHub Action Run
5 ruby3.4-ubuntu - 41935456288.5 04 Nov 2026 11:41PM UTC 446
92.0
GitHub Action Run
6 ruby2.7-ubuntu - 41935456288.6 04 Nov 2026 11:40PM UTC 446
91.97
GitHub Action Run
7 ruby4.0-ubuntu - 41935456288.7 04 Nov 2026 11:41PM UTC 446
92.0
GitHub Action Run
8 ruby2.6-ubuntu - 41935456288.8 04 Nov 2026 11:41PM UTC 446
91.97
GitHub Action Run
Source Files on build 41935456288
  • Tree
  • List 223
  • Changed 222
  • Source Changed 0
  • Coverage Changed 222
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #41935456288
  • 51a541d0 on github
  • Prev Build on main (#41183403761)
  • Next Build on main (#41960837614)
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