Sha256: b89d5aa51fa12b56e428d82467f7b962789ab162442bd86fdf8615f25e5f6061

Contents?: true

Size: 425 Bytes

Versions: 4

Compression:

Stored size: 425 Bytes

Contents

module Overcommit::Hook::PreCommit
  # Runs `golint` against any modified Golang files.
  class GoLint < Base
    def run
      unless in_path?('golint')
        return :warn, 'Run `go get `github.com/golang/lint/golint`'
      end

      result = execute(%w[golint] + applicable_files)
      # Unfortunately the exit code is always 0
      return :good if result.stdout.empty?

      [:bad, result.stdout]
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
overcommit-0.14.1 lib/overcommit/hook/pre_commit/go_lint.rb
overcommit-0.14.0 lib/overcommit/hook/pre_commit/go_lint.rb
overcommit-0.13.0 lib/overcommit/hook/pre_commit/go_lint.rb
overcommit-0.12.0 lib/overcommit/hook/pre_commit/go_lint.rb