Sha256: 25787e829fe7982cf65eeab7e5e9f844e7cda70aeadcfbaa2b8c56036166746f

Contents?: true

Size: 384 Bytes

Versions: 3

Compression:

Stored size: 384 Bytes

Contents

module Overcommit::Hook::PreCommit
  # Runs `flake8` against any modified Python files.
  class PythonFlake8 < Base
    def run
      unless in_path?('flake8')
        return :warn, 'flake8 not installed -- run `pip install flake8`'
      end

      result = execute(%w[flake8] + 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/python_flake8.rb
overcommit-0.16.0 lib/overcommit/hook/pre_commit/python_flake8.rb
overcommit-0.15.0 lib/overcommit/hook/pre_commit/python_flake8.rb