pronto-rubocop 0.2.4 → 0.2.5

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: ff077936fda94c69ae6e4db24df26119151419d0
4
- data.tar.gz: cc35a329b3799388cdf39724dceee8a0fcb36436
3
+ metadata.gz: ffcd61fbeb4a83e97be21ea78b599ae0ddb00b66
4
+ data.tar.gz: dbee3812fef662d62855e9ffb110f2d53b621435
5
5
  SHA512:
6
- metadata.gz: 6bbf9d80d622045cfcf2da32db4cadc087d35d1079a87ae53f7e26fd1ca26fd3a9a8c93a0ceb4b67e3ac9efc078d128a6e2ef82c67c1134c7bef918023dd0f63
7
- data.tar.gz: 95171b6babd6edfffe0c8e3cbc8b6131757d03834974ce2c56926bc45730bde98bb79bc2994dee3e70d506ed7f288775b97b1a8022a868050aca54134ad609b2
6
+ metadata.gz: f6249c3238c4963f1b8091066427fc2f2bcfe5b2dc552b7904fa6efd70b39a53965d22da6a131e62434fc4365e60a767ed72c7df9111edf8e2fc40266c14e390
7
+ data.tar.gz: 0f58342834069357c924687f38a4845fff4c4cafbceb5746c2bac8dbdc8431c335c43e69a587000845144cd6f51e6e420be01dfe41cb68fadfc6258ae9b642a6
@@ -11,10 +11,13 @@ module Pronto
11
11
  def run(patches, _)
12
12
  return [] unless patches
13
13
 
14
- patches.select { |patch| patch.additions > 0 }
15
- .select { |patch| ruby_file?(patch.new_file_full_path) }
16
- .map { |patch| inspect(patch) }
17
- .flatten.compact
14
+ valid_patches = patches.select do |patch|
15
+ patch.additions > 0 &&
16
+ ruby_file?(patch.new_file_full_path) &&
17
+ !excluded?(patch)
18
+ end
19
+
20
+ valid_patches.map { |patch| inspect(patch) }.flatten.compact
18
21
  end
19
22
 
20
23
  def inspect(patch)
@@ -34,6 +37,11 @@ module Pronto
34
37
  Message.new(path, line, level, offence.message)
35
38
  end
36
39
 
40
+ def excluded?(patch)
41
+ path = patch.new_file_full_path.to_s
42
+ @config_store.for(path).file_to_exclude?(path)
43
+ end
44
+
37
45
  def level(severity)
38
46
  case severity
39
47
  when :refactor, :convention
@@ -1,5 +1,5 @@
1
1
  module Pronto
2
2
  module RubocopVersion
3
- VERSION = '0.2.4'
3
+ VERSION = '0.2.5'
4
4
  end
5
5
  end
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.2.4
4
+ version: 0.2.5
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: 2014-06-16 00:00:00.000000000 Z
11
+ date: 2014-06-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop
@@ -96,8 +96,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
96
96
  version: 1.3.6
97
97
  requirements: []
98
98
  rubyforge_project:
99
- rubygems_version: 2.2.2
99
+ rubygems_version: 2.3.0
100
100
  signing_key:
101
101
  specification_version: 4
102
102
  summary: Pronto runner for Rubocop, ruby code analyzer
103
103
  test_files: []
104
+ has_rdoc: