Sha256: b90e99f2b6a9786cc2b9231141cd77331174acfc39d45516f65679bfb4c84381

Contents?: true

Size: 606 Bytes

Versions: 11

Compression:

Stored size: 606 Bytes

Contents

require 'json'
require 'face_control/comment'

module FaceControl
  module Checkers
    class CoffeeLint
      def relevant_globs
        %w(*.coffee)
      end

      def command(filenames)
        "coffeelint --reporter raw #{filenames}"
      end

      def parse(command_output)
        JSON.parse(command_output).map do |file, problems|
          problems.map do |problem|
            Comment.new(
              file: file,
              line: problem['lineNumber'],
              text: "(#{problem['level']}) #{problem['message']}"
            )
          end
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
face_control-1.0.0 lib/face_control/checkers/coffeelint.rb
face_control-0.9.1 lib/face_control/checkers/coffeelint.rb
face_control-0.8.6 lib/face_control/checkers/coffeelint.rb
face_control-0.9.0 lib/face_control/checkers/coffeelint.rb
face_control-0.8.5 lib/face_control/checkers/coffeelint.rb
face_control-0.8.4 lib/face_control/checkers/coffeelint.rb
face_control-0.8.3 lib/face_control/checkers/coffeelint.rb
face_control-0.8.2 lib/face_control/checkers/coffeelint.rb
face_control-0.8.1 lib/face_control/checkers/coffeelint.rb
face_control-0.8.0 lib/face_control/checkers/coffeelint.rb
face_control-0.7.0 lib/face_control/checkers/coffeelint.rb