Sha256: 0f1373a53371cc4f7fc238f56babdc6784620b6fd2b8d1fe09f15b98dabdcd35

Contents?: true

Size: 695 Bytes

Versions: 34

Compression:

Stored size: 695 Bytes

Contents

require 'pre-commit/checks/js'

module PreCommit
  module Checks
    class Csslint < Js

      SOURCE = "https://github.com/stubbornella/csslint/blob/v0.10.0/release/csslint.js"

      def run_check(file)
        context = ExecJS.compile(File.read(linter_src))
        context.call("CSSLint.verify", File.read(file))["messages"]
      end

      def linter_src
        File.expand_path("../../../../pre-commit/support/csslint/csslint.js", __FILE__)
      end

      def error_selector
        'message'
      end

      def files_filter(staged_files)
        staged_files.grep(/\.css$/)
      end

      def self.description
        "Checks CSS files with CSSLint."
      end

    end
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
pre-commit-0.40.0 lib/plugins/pre_commit/checks/csslint.rb
pre-commit-0.39.0 lib/plugins/pre_commit/checks/csslint.rb
pre-commit-0.38.1 lib/plugins/pre_commit/checks/csslint.rb
pre-commit-0.38.0 lib/plugins/pre_commit/checks/csslint.rb
pre-commit-0.37.0 lib/plugins/pre_commit/checks/csslint.rb
pre-commit-0.36.0 lib/plugins/pre_commit/checks/csslint.rb
pre-commit-0.35.0 lib/plugins/pre_commit/checks/csslint.rb
pre-commit-0.34.0 lib/plugins/pre_commit/checks/csslint.rb
pre-commit-0.33.0 lib/plugins/pre_commit/checks/csslint.rb
pre-commit-0.32.0 lib/plugins/pre_commit/checks/csslint.rb
pre-commit-0.31.0 lib/plugins/pre_commit/checks/csslint.rb
pre-commit-0.30.0 lib/plugins/pre_commit/checks/csslint.rb
pre-commit-0.29.0 lib/plugins/pre_commit/checks/csslint.rb
pre-commit-0.28.0 lib/plugins/pre_commit/checks/csslint.rb
pre-commit-0.27.0 lib/plugins/pre_commit/checks/csslint.rb
pre-commit-0.26.0 lib/plugins/pre_commit/checks/csslint.rb
pre-commit-0.25.0 lib/plugins/pre_commit/checks/csslint.rb
pre-commit-0.24.0 lib/plugins/pre_commit/checks/csslint.rb
pre-commit-0.23.0 lib/plugins/pre_commit/checks/csslint.rb
pre-commit-0.22.1 lib/plugins/pre_commit/checks/csslint.rb