face_control 0.2.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 03dee22c5b07fe5f7a4aa9aa257103d07c36b145
4
- data.tar.gz: 6dd0640a2403d94ae261affab0e8fbb07d88913a
3
+ metadata.gz: 5ad2296c7d59f5f47c276cc7841dc93e4a04c751
4
+ data.tar.gz: c378cb084400d8b6f4706a28ebadda530a2e49ad
5
5
  SHA512:
6
- metadata.gz: c2e6664d17b799c634d11d6e931f69674986cae65e9e8d41886309c01858a1830aecf5e0cf641c389ddd7fcb2bcfb044af14590a096e323fe38ffb1d8b1eacf5
7
- data.tar.gz: 3c511c12306a2ecd13d899d44bc9584244e28b0b79ca53e0208f4d929ffc0ccfcd5a4b03442986bc472234495c5dad690a6cd75d6122b8254be5f5776d6a863c
6
+ metadata.gz: ab905002cc6a3c9cd3e65382da52f53f95aec387687f2a6a80e11406c9ab6a8b6bce6578a5a629baea2eedbf5b569b2b5a84e54f0d9daa3fe5f22a49f3cb0af5
7
+ data.tar.gz: 962933f5491a8c240218692e53d4e757cc0b6c97a13f9fceaef7a8ef5b3470486aa4c3603c02fa08fd88ea642de5446c4e2826b75a75bb0ab63f6fa3eccbde4c
data/USAGE CHANGED
@@ -1,8 +1,8 @@
1
1
  Check a pull request in Stash and comment on added lines with issues
2
2
 
3
3
  Usage:
4
- face-control <project> <repository> <pull_request_id>
5
- face-control -h | --help
4
+ face-control [options] <project> <repository> <pull_request_id>
6
5
 
7
6
  Options:
8
- -h --help Show this screen.
7
+ -h --help Show this screen.
8
+ -S <severity>, --skip-severity <severity> Skip RuboCop offenses with this severity.
data/exe/face-control CHANGED
@@ -13,16 +13,20 @@ begin
13
13
  repository = args['<repository>']
14
14
  pull_request_id = args['<pull_request_id>']
15
15
 
16
+ if args['--skip-severity']
17
+ ignored_severities = args['--skip-severity'].split(',')
18
+ puts "Skipping RuboCop offenses with severities: #{ignored_severities.join(', ')}."
19
+ end
20
+
16
21
  config = Stash::Config.new
17
22
  server = Stash::Server.new(config.host, config.user, config.password, Logger.new(STDOUT))
18
23
  repository = server.repository(project, repository)
19
24
  pull_request = repository.pull_request(pull_request_id)
20
25
 
21
26
  [
22
- FaceControl::Inputs::RubocopJson,
23
- FaceControl::Inputs::CoffeeLintRaw
24
- ].each do |input_class|
25
- input = input_class.new
27
+ FaceControl::Inputs::RubocopJson.new(ignored_severities),
28
+ FaceControl::Inputs::CoffeeLintRaw.new
29
+ ].each do |input|
26
30
  input.comments.each do |comment|
27
31
  pull_request.add_comment(comment.file, comment.line, comment.text)
28
32
  end
@@ -4,9 +4,10 @@ require 'face_control/comment'
4
4
  module FaceControl
5
5
  module Inputs
6
6
  class RubocopJson
7
- attr_accessor :filename
7
+ attr_accessor :ignored_severities, :filename
8
8
 
9
- def initialize(filename = 'rubocop.json')
9
+ def initialize(ignored_severities = [], filename = 'rubocop.json')
10
+ self.ignored_severities = ignored_severities
10
11
  self.filename = filename
11
12
 
12
13
  fail "#{filename} does not exist" unless File.exist?(filename)
@@ -14,7 +15,9 @@ module FaceControl
14
15
 
15
16
  def comments
16
17
  report['files'].map do |file|
17
- file['offenses'].map do |offense|
18
+ file['offenses'].reject do |offense|
19
+ ignored_severities.include?(offense['severity'])
20
+ end.map do |offense|
18
21
  Comment.new(
19
22
  file: file['path'],
20
23
  line: offense['location']['line'],
@@ -1,3 +1,3 @@
1
1
  module FaceControl
2
- VERSION = '0.2.1'
2
+ VERSION = '0.3.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: face_control
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ilya Vassilevsky
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-03-16 00:00:00.000000000 Z
11
+ date: 2015-03-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: docopt