Sha256: 9604383e03e034250744e4be93c4e40a15b4f2c1bdaf854ea0ff1f9605807806

Contents?: true

Size: 775 Bytes

Versions: 16

Compression:

Stored size: 775 Bytes

Contents

#!/usr/bin/env ruby

require 'scss_lint'
require 'scss_lint/cli'

module SCSSLint
  class Reporter
    # Formats SCSS Lint output for LintTrap
    class LintTrapReporter < Reporter
      LINE_FORMAT = "%s:%d:%d:%d:%s:%s:%s\n"

      def report_lints
        return unless lints.any?

        lints.map{|lint| LINE_FORMAT % variables(lint)}.join('')
      end

      def variables(lint)
        file = lint.filename
        line = lint.location.line
        column = lint.location.column
        length = lint.location.length

        rule = lint.linter ? lint.linter.name : ''
        severity = lint.severity.to_s
        message = lint.description

        [file, line, column, length, rule, severity, message]
      end
    end
  end
end

exit SCSSLint::CLI.new.run(ARGV)

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
lint_trap-0.0.19 config/scsslint/scsslint
lint_trap-0.0.18 config/scsslint/scsslint
lint_trap-0.0.17 config/scsslint/scsslint
lint_trap-0.0.16 config/scsslint/scsslint
lint_trap-0.0.15 config/scsslint/scsslint
lint_trap-0.0.14 config/scsslint/scsslint
lint_trap-0.0.13 config/scsslint/scsslint
lint_trap-0.0.11 config/scsslint/scsslint
lint_trap-0.0.10 config/scsslint/scsslint
lint_trap-0.0.9 config/scsslint/scsslint
lint_trap-0.0.8 config/scsslint/scsslint
lint_trap-0.0.7 config/scsslint/scsslint
lint_trap-0.0.6 config/scsslint/scsslint
lint_trap-0.0.5 config/scsslint/scsslint
lint_trap-0.0.4 config/scsslint/scsslint
lint_trap-0.0.3 config/scsslint/scsslint