Sha256: d0ce14c64f6ff60e1b6c9a4fd256a283d805ed152bf83462be2110fd932c66ce
Contents?: true
Size: 589 Bytes
Versions: 5
Compression:
Stored size: 589 Bytes
Contents
module Overcommit::Hook::PreCommit # Runs `stylelint` against any modified CSS file. # # @see https://github.com/stylelint/stylelint class Stylelint < Base # example of output: # index.css: line 4, col 4, error - Expected indentation of 2 spaces (indentation) MESSAGE_REGEX = /^(?<file>.+):\D*(?<line>\d).*$/ 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 ) end end end
Version data entries
5 entries across 3 versions & 2 rubygems