lib/overcommit/plugins/pre_commit/js_syntax.rb in overcommit-0.1.7 vs lib/overcommit/plugins/pre_commit/js_syntax.rb in overcommit-0.1.8
- old
+ new
@@ -4,10 +4,13 @@
file_type :js
def run_check
return :warn, 'Need either `jshint` or `rhino` in path' unless runner
- output = runner.call(staged.join(' ')).split("\n")
+ paths = staged.map { |s| s.path }.join(' ')
+ output = runner.call(paths).split("\n")
+ staged.each { |s| output = s.filter_string(output) }
+
return (output.none? ? :good : :bad), output
end
private