Sha256: e11d76d15ca1940fe731bbe0e319c73325b6ead683a5798aad84a26c35ac0e34

Contents?: true

Size: 575 Bytes

Versions: 7

Compression:

Stored size: 575 Bytes

Contents

require 'pre-commit/checks/shell'

module PreCommit
  module Checks
    class ScssLint < Shell

      def call(staged_files)
        staged_files = staged_files.grep(/\.scss$/)
        return if staged_files.empty?

        args = (config_file_flag + staged_files).join(' ')

        execute("scss-lint #{args}")
      end

      def config_file_flag
        config_file ? ['-c', config_file] : []
      end

      def alternate_config_file
        '.scss-lint.yml'
      end

      def self.description
        "Runs scss lint to detect errors"
      end

    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
pre-commit-0.19.0 lib/plugins/pre_commit/checks/scss_lint.rb
pre-commit-0.18.0 lib/plugins/pre_commit/checks/scss_lint.rb
pre-commit-0.17.0 lib/plugins/pre_commit/checks/scss_lint.rb
pre-commit-0.16.3 lib/plugins/pre_commit/checks/scss_lint.rb
pre-commit-0.16.2 lib/plugins/pre_commit/checks/scss_lint.rb
pre-commit-0.16.1 lib/plugins/pre_commit/checks/scss_lint.rb
pre-commit-0.16.0 lib/plugins/pre_commit/checks/scss_lint.rb