lib/plugins/pre_commit/checks/coffeelint.rb in pre-commit-0.15.0 vs lib/plugins/pre_commit/checks/coffeelint.rb in pre-commit-0.16.0
- old
+ new
@@ -1,19 +1,17 @@
-require 'open3'
-require 'pre-commit/checks/plugin'
+require 'pre-commit/checks/shell'
module PreCommit
module Checks
- class Coffeelint < Plugin
+ class Coffeelint < Shell
def call(staged_files)
staged_files = staged_files.grep(/\.coffee$/)
return if staged_files.empty?
args = (config_file_flag + staged_files).join(' ')
- stdout, stderr, result = Open3.capture3("coffeelint #{args}")
- stdout + stderr unless result.success?
+ execute("coffeelint #{args}")
end
def config_file_flag
config_file ? ['-f', config_file] : []
end