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

sds / overcommit / 1152
91%

Build:
DEFAULT BRANCH: master
Ran 12 Feb 2016 03:46PM UTC
Jobs 7
Files 142
Run time 9min
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

pending completion
1152

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

2482 of 2869 relevant lines covered (86.51%)

229.69 hits per line

Jobs
ID Job ID Ran Files Coverage
1 1152.1 (1.9.3) 12 Feb 2016 03:48PM UTC 0
87.88
Travis Job 1152.1
2 1152.2 (2.0) 12 Feb 2016 03:46PM UTC 0
87.9
Travis Job 1152.2
3 1152.3 (2.1) 12 Feb 2016 03:46PM UTC 0
87.9
Travis Job 1152.3
4 1152.4 (2.2) 12 Feb 2016 03:46PM UTC 0
87.94
Travis Job 1152.4
5 1152.5 (2.3.0) 12 Feb 2016 03:48PM UTC 0
87.9
Travis Job 1152.5
6 1152.6 (jruby-19mode) 12 Feb 2016 03:54PM UTC 0
85.97
Travis Job 1152.6
7 1152.7 (rbx-2) 12 Feb 2016 03:54PM UTC 0
92.61
Travis Job 1152.7
Source Files on build 1152
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #1152
  • d8fa43b5 on github
  • Prev Build on master (#1146)
  • Next Build on master (#1153)
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