pronto-rubocop 0.4.6 → 0.4.7
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/lib/pronto/rubocop.rb +16 -8
- data/lib/pronto/rubocop/version.rb +1 -1
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b0798d8be503387f7c82fd03ec3f62583ec0b37a
|
4
|
+
data.tar.gz: 1149663e0f9e558aa9978786aea8a46ba6eb9c90
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 21d83a83a93c7f35c5ea076eb7870d3e80303c3b1d71539a6c970170c97e5c87d626b8e0eddc1e27920051836a0f91e98dc9af12fba93e494d1b36bb8ff21d80
|
7
|
+
data.tar.gz: 05c4e0af675b7c347900b6f9fa84032f83981dc4d875e9dbbf8e49297e5d5748da728fba36bdcd510b725ed3694366010cf243ef92683b3d4e2610a19e01a3ff
|
data/lib/pronto/rubocop.rb
CHANGED
@@ -11,13 +11,21 @@ module Pronto
|
|
11
11
|
def run(patches, _)
|
12
12
|
return [] unless patches
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
14
|
+
patches.select { |patch| valid_patch?(patch) }
|
15
|
+
.map { |patch| inspect(patch) }
|
16
|
+
.flatten.compact
|
17
|
+
end
|
18
|
+
|
19
|
+
def valid_patch?(patch)
|
20
|
+
return false if patch.additions < 1
|
21
|
+
|
22
|
+
config_store = config_store_for(patch)
|
23
|
+
path = patch.new_file_full_path
|
24
|
+
|
25
|
+
return false if config_store.file_to_exclude?(path.to_s)
|
26
|
+
return true if config_store.file_to_include?(path.to_s)
|
19
27
|
|
20
|
-
|
28
|
+
ruby_file?(path)
|
21
29
|
end
|
22
30
|
|
23
31
|
def inspect(patch)
|
@@ -37,9 +45,9 @@ module Pronto
|
|
37
45
|
Message.new(path, line, level, offence.message)
|
38
46
|
end
|
39
47
|
|
40
|
-
def
|
48
|
+
def config_store_for(patch)
|
41
49
|
path = patch.new_file_full_path.to_s
|
42
|
-
@config_store.for(path)
|
50
|
+
@config_store.for(path)
|
43
51
|
end
|
44
52
|
|
45
53
|
def level(severity)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pronto-rubocop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mindaugas Mozūras
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-10-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubocop
|
@@ -115,4 +115,3 @@ signing_key:
|
|
115
115
|
specification_version: 4
|
116
116
|
summary: Pronto runner for Rubocop, ruby code analyzer
|
117
117
|
test_files: []
|
118
|
-
has_rdoc:
|