pronto-foodcritic 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pronto/foodcritic.rb +19 -17
- data/lib/pronto/foodcritic/version.rb +1 -1
- metadata +8 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 78bb8a5fcc9733a8355d0ab87cd9def9dc7777ad
|
4
|
+
data.tar.gz: 78cc9bd70a0b3647994dc10bee89ed2c65cd7053
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 631e586c960b9cf990aba7ecad880657db4521617915b61a1e3725de91e8375c7152439c5eae602d711e6c42ff1d7216f441319235b4ef5034203ff5b301779d
|
7
|
+
data.tar.gz: 3bbe7991d7db482d9c9a91af97bdc27f5d7681a7223ed657b32be5d3b67b6c7dd57c3d451063df93cedff80e794ed630f2302751acfa9aad16caf939d5163516
|
data/lib/pronto/foodcritic.rb
CHANGED
@@ -10,26 +10,28 @@ module Pronto
|
|
10
10
|
def run(patches, _)
|
11
11
|
return [] unless patches
|
12
12
|
|
13
|
-
patches.select { |patch| patch.additions > 0 }
|
14
|
-
|
15
|
-
.map { |patch| inspect(patch) }
|
16
|
-
.flatten.compact
|
17
|
-
end
|
13
|
+
ruby_patches = patches.select { |patch| patch.additions > 0 }
|
14
|
+
.select { |patch| ruby_file?(patch.new_file_full_path) }
|
18
15
|
|
19
|
-
|
20
|
-
|
21
|
-
path_type = if path.include?('cookbook')
|
22
|
-
:cookbook_paths
|
23
|
-
elsif path.include?('role')
|
24
|
-
:role_paths
|
25
|
-
end
|
16
|
+
inspect(ruby_patches)
|
17
|
+
end
|
26
18
|
|
27
|
-
|
19
|
+
def inspect(patches)
|
20
|
+
paths = { cookbook_paths: [], role_paths: [] }
|
21
|
+
patches.each do |patch|
|
22
|
+
path = patch.new_file_full_path.to_s
|
23
|
+
if path.include?('cookbook')
|
24
|
+
paths[:cookbook_paths] << path
|
25
|
+
elsif path.include?('role')
|
26
|
+
paths[:role_paths] << path
|
27
|
+
end
|
28
|
+
end
|
28
29
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
30
|
+
@linter.check(paths).warnings.flat_map do |warning|
|
31
|
+
patches.select { |patch| patch.new_file_full_path.to_s == warning.match[:filename] }
|
32
|
+
.flat_map(&:added_lines)
|
33
|
+
.select { |line| line.new_lineno == warning.match[:line] }
|
34
|
+
.flat_map { |line| new_message(warning, line) }
|
33
35
|
end
|
34
36
|
end
|
35
37
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pronto-foodcritic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
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-
|
11
|
+
date: 2014-08-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: foodcritic
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 4.0.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 4.0.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: pronto
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - ~>
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 10.
|
47
|
+
version: 10.3.0
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 10.
|
54
|
+
version: 10.3.0
|
55
55
|
description:
|
56
56
|
email: mindaugas.mozuras@gmail.com
|
57
57
|
executables: []
|
@@ -82,8 +82,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
82
82
|
version: 1.3.6
|
83
83
|
requirements: []
|
84
84
|
rubyforge_project:
|
85
|
-
rubygems_version: 2.
|
85
|
+
rubygems_version: 2.3.0
|
86
86
|
signing_key:
|
87
87
|
specification_version: 4
|
88
88
|
summary: Pronto runner for Food Critic, lint tool for chef
|
89
89
|
test_files: []
|
90
|
+
has_rdoc:
|