Sha256: 6295599141dc5b341ee584fc332725b1b7a7dac2819bfdaac8b3f2d9164b4889
Contents?: true
Size: 596 Bytes
Versions: 28
Compression:
Stored size: 596 Bytes
Contents
# frozen_string_literal: true module Overcommit::Hook::PreCommit # Runs `pep257` against any modified Python files. # # @see https://pypi.python.org/pypi/pep257 class Pep257 < Base def run result = execute(command, args: applicable_files) return :pass if result.success? output = result.stderr.chomp # example message: # path/to/file.py:1 in public method `foo`: # D102: Docstring missing extract_messages( output.gsub(/:\s+/, ': ').split("\n"), /^(?<file>(?:\w:)?[^:]+):(?<line>\d+)/ ) end end end
Version data entries
28 entries across 28 versions & 2 rubygems