Sha256: 37abe7a949429ab607cf51382d47c35028e74fc6b6044e40edd5a7a9f0c4bdce
Contents?: true
Size: 507 Bytes
Versions: 9
Compression:
Stored size: 507 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.collect(&: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
9 entries across 9 versions & 1 rubygems