Sha256: ae6c0bbf88a8fc486573e11e9b80a8a6db5b02543b8c993b90ae743cc5b34f3b
Contents?: true
Size: 616 Bytes
Versions: 28
Compression:
Stored size: 616 Bytes
Contents
module Overcommit::Hook::PreCommit # Runs `pep8` against any modified Python files. # # @see https://pypi.python.org/pypi/pep8 class Pep8 < Base def run result = execute(command, args: applicable_files) output = result.stdout.chomp return :pass if result.success? && output.empty? # example message: # path/to/file.py:88:5: E301 expected 1 blank line, found 0 extract_messages( output.split("\n"), /^(?<file>(?:\w:)?[^:]+):(?<line>\d+):\d+:\s(?<type>E|W)/, lambda { |type| type.include?('W') ? :warning : :error } ) end end end
Version data entries
28 entries across 26 versions & 2 rubygems