face_control 0.4.0 → 0.5.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: 0b7fb7f8377a562ed6d7f93630be8335c055a040
4
- data.tar.gz: fdcb1fec8c9135b40c963116586ed9cb87010df9
3
+ metadata.gz: 20ccdb02b1275a56ed0c5a87ffc919d746f11ee0
4
+ data.tar.gz: c990afbc32fc9b6880e7d05a59cf162decc13a2d
5
5
  SHA512:
6
- metadata.gz: 52d0f63b1470830f11c5ca3833e0a3ced5bc28e3373de2a0527ab6cecd7f0366c4b51a7a69f410d84818dc1c4f453b51651a8fcfb866b365e5ca50dbd4553a6f
7
- data.tar.gz: 84cb319bb7b8ab7fc6d87316528f7c77dba40163839261539463d1dacb1c110d24426118d1e900876f684020614fe4b65cceed1d2aa077eb085e38e3362b89c7
6
+ metadata.gz: 7450231dec6d6ff3cf5699001bddaaa008899c7db5d79d3c76c26b734a7496d2fe6214f9836ac7f3ce18dc3c37e1e400c54dcd664b70f5d95a46ad9fd2c686df
7
+ data.tar.gz: 8108d383f13c5c5107b54f4f49f4af90d16a3ad122cfed4084f5be33ce6046a0103a40a3ebc14f26317e0c1e4b129b1a8dd5577513855b9cd3aaf423ab9cfaf4
data/.gitignore CHANGED
@@ -1,9 +1,10 @@
1
- /.bundle/
2
- /.yardoc
3
- /Gemfile.lock
4
- /_yardoc/
5
- /coverage/
6
- /doc/
7
- /pkg/
8
- /spec/reports/
9
- /tmp/
1
+ .bundle/
2
+ .yardoc
3
+ Gemfile.lock
4
+ _yardoc/
5
+ bin/
6
+ coverage/
7
+ doc/
8
+ pkg/
9
+ spec/reports/
10
+ tmp/
data/.rubocop.yml CHANGED
@@ -8,9 +8,6 @@ Style/FileName:
8
8
  Exclude:
9
9
  - exe/*
10
10
 
11
- Style/RegexpLiteral:
12
- MaxSlashes: 0
13
-
14
11
  Style/SpaceBeforeBlockBraces:
15
12
  EnforcedStyle: no_space
16
13
 
@@ -22,7 +22,7 @@ module FaceControl
22
22
  Comment.new(
23
23
  file: file['path'],
24
24
  line: offense['location']['line'],
25
- text: text(offense)
25
+ text: text(offense, file)
26
26
  )
27
27
  end
28
28
  end.flatten
@@ -34,13 +34,17 @@ module FaceControl
34
34
  JSON.parse(File.read(filename))
35
35
  end
36
36
 
37
- def text(offense)
37
+ def text(offense, file)
38
38
  text = offense['message']
39
39
 
40
40
  if (link = style_guide_url(offense))
41
41
  text << " — [Guide](#{link})"
42
42
  end
43
43
 
44
+ if can_be_autocorrected?(offense)
45
+ text << " (Run `rubocop -a #{file['path']}` to fix.)"
46
+ end
47
+
44
48
  text
45
49
  end
46
50
 
@@ -49,6 +53,10 @@ module FaceControl
49
53
  cop_config = RuboCop::ConfigLoader.default_configuration[cop_name]
50
54
  cop_config['StyleGuide']
51
55
  end
56
+
57
+ def can_be_autocorrected?(offense)
58
+ !offense['corrected'].nil?
59
+ end
52
60
  end
53
61
  end
54
62
  end
@@ -1,3 +1,3 @@
1
1
  module FaceControl
2
- VERSION = '0.4.0'
2
+ VERSION = '0.5.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.4.0
4
+ version: 0.5.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-23 00:00:00.000000000 Z
11
+ date: 2015-04-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: docopt
@@ -135,7 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
135
135
  version: '0'
136
136
  requirements: []
137
137
  rubyforge_project:
138
- rubygems_version: 2.4.5
138
+ rubygems_version: 2.2.2
139
139
  signing_key:
140
140
  specification_version: 4
141
141
  summary: Checks Atlassian Stash pull requests and comments on issues in added code