Sha256: caf58fc38a928bfda90bffc1014023c86ad6b9d3039f6afe712ead3cbec3d5f8
Contents?: true
Size: 510 Bytes
Versions: 4
Compression:
Stored size: 510 Bytes
Contents
module Overcommit::GitHook class CssLinter < HookSpecificCheck include HookRegistry file_type :css CSS_LINTER_PATH = Overcommit::Utils.script_path 'csslint-rhino.js' def run_check return :warn, "Rhino is not installed" unless in_path? 'rhino' paths = staged.map { |s| s.path }.join(' ') output = `rhino #{CSS_LINTER_PATH} --quiet --format=compact #{paths} | grep 'Error - '` return (output !~ /Error - (?!Unknown @ rule)/ ? :good : :bad), output end end end
Version data entries
4 entries across 4 versions & 1 rubygems