Sha256: f63b47a28b867a78ed23cd46b2141f756bc35d10bd06924f54cee754ba1912eb
Contents?: true
Size: 619 Bytes
Versions: 28
Compression:
Stored size: 619 Bytes
Contents
module Overcommit::Hook::PreCommit # Runs 'sqlint' against any modified SQL files. # # @see https://github.com/purcell/sqlint class Sqlint < Base MESSAGE_REGEX = /(?<file>(?:\w:)?.+):(?<line>\d+):\d+:(?<type>\w+)/ MESSAGE_TYPE_CATEGORIZER = lambda do |type| type == 'ERROR' ? :error : :warning end def run result = execute(command, args: applicable_files) output = result.stdout.chomp return :pass if result.success? && output.empty? extract_messages( output.split("\n"), MESSAGE_REGEX, MESSAGE_TYPE_CATEGORIZER ) end end end
Version data entries
28 entries across 26 versions & 2 rubygems