Sha256: f6e3a611554e734f5d64e0a23b97d99f6b031d12f9294cdc0e79c406020a4508

Contents?: true

Size: 406 Bytes

Versions: 3

Compression:

Stored size: 406 Bytes

Contents

module Overcommit::Hook::PreCommit
  # Runs `jshint` against any modified JavaScript files.
  class JsHint < Base
    def run
      unless in_path?('jshint')
        return :warn, 'jshint not installed -- run `npm install -g jshint`'
      end

      result = execute(%w[jshint] + applicable_files)
      output = result.stdout

      return :pass if output.empty?

      [:fail, output]
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
overcommit-0.17.0 lib/overcommit/hook/pre_commit/js_hint.rb
overcommit-0.16.0 lib/overcommit/hook/pre_commit/js_hint.rb
overcommit-0.15.0 lib/overcommit/hook/pre_commit/js_hint.rb