Sha256: e2bc9bcfd455c9a7736704cca8c74466f929cf1e8f974c92f5040061c46a97ff

Contents?: true

Size: 1.01 KB

Versions: 3

Compression:

Stored size: 1.01 KB

Contents

#!/usr/bin/env ruby

require 'logger'
require 'docopt'
require 'face_control'
require 'stash'

begin
  USAGE = "#{File.dirname(__FILE__)}/../USAGE"
  args = Docopt.docopt(File.read(USAGE))

  project         = args['<project>']
  repository      = args['<repository>']
  pull_request_id = args['<pull_request_id>']

  if args['--skip-severity']
    ignored_severities = args['--skip-severity'].split(',')
    puts "Skipping RuboCop offenses with severities: #{ignored_severities.join(', ')}."
  end

  config = Stash::Config.new
  server = Stash::Server.new(config.host, config.user, config.password, Logger.new(STDOUT))
  repository = server.repository(project, repository)
  pull_request = repository.pull_request(pull_request_id)

  [
    FaceControl::Inputs::RubocopJson.new(ignored_severities),
    FaceControl::Inputs::CoffeeLintRaw.new
  ].each do |input|
    input.comments.each do |comment|
      pull_request.add_comment(comment.file, comment.line, comment.text)
    end
  end
rescue Docopt::Exit => e
  puts e.message
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
face_control-0.5.0 exe/face-control
face_control-0.4.0 exe/face-control
face_control-0.3.0 exe/face-control