Sha256: 79ead7d9c2a769124a8797232801598c3f8554265860dc6bcdb599673c76fc9a
Contents?: true
Size: 640 Bytes
Versions: 19
Compression:
Stored size: 640 Bytes
Contents
# frozen_string_literal: true 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
19 entries across 19 versions & 2 rubygems