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 +4 -4
- data/USAGE +3 -3
- data/exe/face-control +8 -4
- data/lib/face_control/inputs/rubocop_json.rb +6 -3
- data/lib/face_control/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5ad2296c7d59f5f47c276cc7841dc93e4a04c751
|
4
|
+
data.tar.gz: c378cb084400d8b6f4706a28ebadda530a2e49ad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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 |
|
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'].
|
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'],
|
data/lib/face_control/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2015-03-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: docopt
|