Sha256: ccb854a6579a49bc056f51a4ec9f24c3a9313b8f84854c24498b97caa6bb4ed5
Contents?: true
Size: 609 Bytes
Versions: 28
Compression:
Stored size: 609 Bytes
Contents
module Overcommit::Hook::PreCommit # Runs `csslint` against any modified CSS files. # # @see https://github.com/CSSLint/csslint class CssLint < Base MESSAGE_REGEX = / ^(?<file>(?:\w:)?[^:]+):\s (?:line\s(?<line>\d+)[^EW]+)? (?<type>Error|Warning) /x def run result = execute(command, args: applicable_files) output = result.stdout.chomp return :pass if result.success? && output.empty? extract_messages( output.split("\n").reject(&:empty?), MESSAGE_REGEX, lambda { |type| type.downcase.to_sym } ) end end end
Version data entries
28 entries across 26 versions & 2 rubygems