Skip to content

Commit e2d76fa

Browse files
author
Shane da Silva
committed
Display warning message in BundleCheck hook
The post-checkout `BundleCheck` hook would return a warning status but not display a message if the dependencies were out of date. Change it to actually display a warning message. Change-Id: I064b5777108967d3e571e46e48d31dd64282d197 Reviewed-on: http://gerrit.causes.com/36485 Tested-by: jenkins <jenkins@causes.com> Reviewed-by: Shane da Silva <shane@causes.com>
1 parent e40aa43 commit e2d76fa

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
* Add pre-commit `TravisLint` hook which uses the
66
[travis-lint](https://github.com/travis-ci/travis-lint) gem
7+
* Display actual warning message when dependencies aren't satisifed in
8+
post-checkout `BundleCheck` hook
79

810
## 0.7.0
911

lib/overcommit/hook/post_checkout/bundle_check.rb

+5-1
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,17 @@ def run
77
return :warn, 'bundler not installed -- run `gem install bundler`'
88
end
99

10-
return :warn if dependencies_changed? && !dependencies_satisfied?
10+
if dependencies_changed? && !dependencies_satisfied?
11+
return :warn, "#{LOCK_FILE} is not up-to-date -- run `bundle check`"
12+
end
1113

1214
:good
1315
end
1416

1517
private
1618

19+
LOCK_FILE = 'Gemfile.lock'
20+
1721
def dependencies_changed?
1822
result = execute(%w[git diff --exit-code --name-only] + [new_head, previous_head])
1923

0 commit comments

Comments
 (0)