face_control 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5ad2296c7d59f5f47c276cc7841dc93e4a04c751
4
- data.tar.gz: c378cb084400d8b6f4706a28ebadda530a2e49ad
3
+ metadata.gz: 0b7fb7f8377a562ed6d7f93630be8335c055a040
4
+ data.tar.gz: fdcb1fec8c9135b40c963116586ed9cb87010df9
5
5
  SHA512:
6
- metadata.gz: ab905002cc6a3c9cd3e65382da52f53f95aec387687f2a6a80e11406c9ab6a8b6bce6578a5a629baea2eedbf5b569b2b5a84e54f0d9daa3fe5f22a49f3cb0af5
7
- data.tar.gz: 962933f5491a8c240218692e53d4e757cc0b6c97a13f9fceaef7a8ef5b3470486aa4c3603c02fa08fd88ea642de5446c4e2826b75a75bb0ab63f6fa3eccbde4c
6
+ metadata.gz: 52d0f63b1470830f11c5ca3833e0a3ced5bc28e3373de2a0527ab6cecd7f0366c4b51a7a69f410d84818dc1c4f453b51651a8fcfb866b365e5ca50dbd4553a6f
7
+ data.tar.gz: 84cb319bb7b8ab7fc6d87316528f7c77dba40163839261539463d1dacb1c110d24426118d1e900876f684020614fe4b65cceed1d2aa077eb085e38e3362b89c7
data/README.md CHANGED
@@ -19,3 +19,7 @@ Inspired by [Hound](https://houndci.com).
19
19
  `face-control` uses the same configuration file (`~/.stashconfig.yml`)
20
20
  as the official [Atlassian Stash Command Line Tools](https://bitbucket.org/atlassian/stash-command-line-tools)
21
21
  to connect to your Stash instance.
22
+
23
+ ## Etymology
24
+
25
+ [Face control](http://en.wikipedia.org/wiki/Face_control) in Wikipedia
data/face_control.gemspec CHANGED
@@ -18,6 +18,7 @@ Gem::Specification.new do |spec|
18
18
  spec.require_paths = ['lib']
19
19
 
20
20
  spec.add_runtime_dependency 'docopt'
21
+ spec.add_runtime_dependency 'rubocop'
21
22
  spec.add_runtime_dependency 'httparty'
22
23
 
23
24
  spec.add_development_dependency 'bundler', '~> 1.8'
@@ -1,4 +1,5 @@
1
1
  require 'json'
2
+ require 'rubocop'
2
3
  require 'face_control/comment'
3
4
 
4
5
  module FaceControl
@@ -21,7 +22,7 @@ module FaceControl
21
22
  Comment.new(
22
23
  file: file['path'],
23
24
  line: offense['location']['line'],
24
- text: offense['message']
25
+ text: text(offense)
25
26
  )
26
27
  end
27
28
  end.flatten
@@ -32,6 +33,22 @@ module FaceControl
32
33
  def report
33
34
  JSON.parse(File.read(filename))
34
35
  end
36
+
37
+ def text(offense)
38
+ text = offense['message']
39
+
40
+ if (link = style_guide_url(offense))
41
+ text << " — [Guide](#{link})"
42
+ end
43
+
44
+ text
45
+ end
46
+
47
+ def style_guide_url(offense)
48
+ cop_name = offense['cop_name']
49
+ cop_config = RuboCop::ConfigLoader.default_configuration[cop_name]
50
+ cop_config['StyleGuide']
51
+ end
35
52
  end
36
53
  end
37
54
  end
@@ -1,3 +1,3 @@
1
1
  module FaceControl
2
- VERSION = '0.3.0'
2
+ VERSION = '0.4.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.3.0
4
+ version: 0.4.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-19 00:00:00.000000000 Z
11
+ date: 2015-03-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: docopt
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rubocop
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: httparty
29
43
  requirement: !ruby/object:Gem::Requirement