Sha256: 78096b183adc34de5d208548d857b60708d2e4a4688c832c7cde317a8d5a56ee

Contents?: true

Size: 437 Bytes

Versions: 3

Compression:

Stored size: 437 Bytes

Contents

module Overcommit::Hook::PreCommit
  # Runs `brakeman` against any modified Ruby/Rails files.
  class Brakeman < Base
    def run
      unless in_path?('brakeman')
        return :warn, 'Run `gem install brakeman`'
      end

      result = execute(%w[brakeman --exit-on-warn --quiet --summary --only-files] +
                       applicable_files)
      return :pass if result.success?

      [:fail, result.stdout]
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

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