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

sds / overcommit / 1152 / 4
91%
master: 91%

Build:
DEFAULT BRANCH: master
Ran 12 Feb 2016 03:46PM UTC
Files 142
Run time 5s
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 Feb 2016 03:32PM UTC coverage: 87.942% (-0.06%) from 88.006%
2.2

push

travis-ci

sds
Improve error output on extract_messages failure

The `extract_messages` helper was designed to fail loudly if the
input didn't match what was expected by the regex. The goal was to help
hook authors debug and catch these issues quickly and easily.

However, there are some situations where hook authors did nothing wrong,
for example if you are using `rbenv` and on a version of Ruby where a
gem hasn't yet been installed (but the shim already exists), you'll get
an error like the following:

    The `rubocop' command exists in these Ruby versions:
      1.9.3-p551
      2.1.1
      2.1.2
      2.2.1
      2.2.2
      2.3.0
      jruby-1.7.20

...which appears like the following in the hook error output:

    Analyzing with RuboCop..............................[RuboCop] FAILED
    Hook raised unexpected error
    Unexpected output: unable to determine line number or type of
    error/warning for message ''
    lib/overcommit/hook/pre_commit/base.rb:31:in `block in extract_messages'
    lib/overcommit/hook/pre_commit/base.rb:28:in `map'
    lib/overcommit/hook/pre_commit/base.rb:28:in `extract_messages'
    lib/overcommit/hook/pre_commit/rubo_cop.rb:19:in `run'
    lib/overcommit/hook/base.rb:45:in `block in run_and_transform'
    lib/overcommit/utils.rb:259:in `with_environment'
    lib/overcommit/hook/base.rb:45:in `run_and_transform'
    lib/overcommit/hook_runner.rb:152:in `run_hook'
    lib/overcommit/hook_runner.rb:88:in `block in consume'
    lib/overcommit/hook_runner.rb:85:in `loop'
    lib/overcommit/hook_runner.rb:85:in `consume'

The stacktrace in this case is unsightly and doesn't explain what's
actually going on.

Fix this by throwing a special class of error and printing the remaining
unprocessed output.

Fixes #335

2239 of 2546 relevant lines covered (87.94%)

39.31 hits per line

Source Files on job 1152.4 (2.2)
  • Tree
  • List 0
  • Changed 4
  • Source Changed 3
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 1152
  • Travis Job 1152.4
  • d8fa43b5 on github
  • Prev Job for 2.2 on master (#1146.4)
  • Next Job for 2.2 on master (#1153.4)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc