Class: Overcommit::Hook::PreCommit::CoffeeLint
- Defined in:
- lib/overcommit/hook/pre_commit/coffee_lint.rb
Overview
Runs ‘coffeelint` against any modified CoffeeScript files.
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
#applicable_files, #command, #description, #enabled?, #execute, #execute_in_background, #flags, #in_path?, #initialize, #name, #process_hook_return_value, #quiet?, #required?, #required_executable, #required_libraries, #run?, #run_and_transform, #skip?
Constructor Details
This class inherits a constructor from Overcommit::Hook::Base
Instance Method Details
#run ⇒ Object
4 5 6 7 8 9 10 11 12 |
# File 'lib/overcommit/hook/pre_commit/coffee_lint.rb', line 4 def run result = execute(command + applicable_files) begin (result.stdout) rescue JSON::ParserError => e [:fail, "Error parsing coffeelint output: #{e.}"] end end |