Sha256: 9bae6c9c878dd57b63a72f761bb274158a7ce33e2f4b7082966bc2e275540617
Contents?: true
Size: 561 Bytes
Versions: 28
Compression:
Stored size: 561 Bytes
Contents
module Overcommit::Hook::PreCommit # Runs `scalariform` against any modified Scala files. # # @see https://github.com/mdr/scalariform class Scalariform < Base MESSAGE_REGEX = /^\[(?<type>FAILED|ERROR)\]\s+(?<file>(?:\w:)?.+)/ def run result = execute(command, args: applicable_files) # example message: # [FAILED] path/to/file.scala extract_messages( result.stdout.split("\n").grep(MESSAGE_REGEX), MESSAGE_REGEX, lambda { |type| type == 'ERROR' ? :error : :warning } ) end end end
Version data entries
28 entries across 26 versions & 2 rubygems