Sha256: d66d0f9d8ae7a06050c6430674318582dfe3fd36824d604548cdae17325f9b25

Contents?: true

Size: 693 Bytes

Versions: 23

Compression:

Stored size: 693 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?

        result =
        in_groups(staged_files).map do |files|
          args = %w{scss-lint} + config_file_flag + files
          execute(args)
        end.compact

        result.empty? ? nil : result.join("\n")
      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

23 entries across 23 versions & 1 rubygems

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