pronto-foodcritic 0.2.1 → 0.2.2
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/version.rb +1 -1
- data/lib/pronto/foodcritic.rb +13 -7
- metadata +10 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ce18addbe15a207e5102169b44c064b64792fc46
|
4
|
+
data.tar.gz: e6588ba7fd983de7ebe7e9268eba447c0e530896
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a07f005f8619f730fe013c07178ec0bcce6490443e4c5529d409ccf1c8d5e2db6474f26e103153ab0bc64d4ced9970b01441db3e3f6f99c49c1cf87069d3b1ea
|
7
|
+
data.tar.gz: 33910fa2fbf3b28ddc18e290e10ae5e9b03b4504346b671cc1b64571271b426d94c728ae58f44f96048dfe8d218ae6761c2846c605bbf0ddff0dc855a2cd7ad6
|
data/lib/pronto/foodcritic.rb
CHANGED
@@ -17,6 +17,18 @@ module Pronto
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def inspect(patches)
|
20
|
+
paths = chef_paths(patches)
|
21
|
+
return [] if paths[:cookbook_paths].none? && paths[:role_paths].none?
|
22
|
+
|
23
|
+
@linter.check(paths).warnings.flat_map do |warning|
|
24
|
+
patches.select { |patch| patch.new_file_full_path.to_s == warning.match[:filename] }
|
25
|
+
.flat_map(&:added_lines)
|
26
|
+
.select { |line| line.new_lineno == warning.match[:line] }
|
27
|
+
.flat_map { |line| new_message(warning, line) }
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
def chef_paths(patches)
|
20
32
|
paths = { cookbook_paths: [], role_paths: [] }
|
21
33
|
patches.each do |patch|
|
22
34
|
path = patch.new_file_full_path.to_s
|
@@ -26,13 +38,7 @@ module Pronto
|
|
26
38
|
paths[:role_paths] << path
|
27
39
|
end
|
28
40
|
end
|
29
|
-
|
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) }
|
35
|
-
end
|
41
|
+
paths
|
36
42
|
end
|
37
43
|
|
38
44
|
def new_message(warning, line)
|
metadata
CHANGED
@@ -1,55 +1,55 @@
|
|
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.2
|
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-08-
|
11
|
+
date: 2014-08-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: foodcritic
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
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
26
|
version: 4.0.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: pronto
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - ~>
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: 0.2.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - ~>
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 0.2.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - ~>
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
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
54
|
version: 10.3.0
|
55
55
|
description:
|
@@ -72,12 +72,12 @@ require_paths:
|
|
72
72
|
- lib
|
73
73
|
required_ruby_version: !ruby/object:Gem::Requirement
|
74
74
|
requirements:
|
75
|
-
- -
|
75
|
+
- - ">="
|
76
76
|
- !ruby/object:Gem::Version
|
77
77
|
version: '0'
|
78
78
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: 1.3.6
|
83
83
|
requirements: []
|
@@ -87,4 +87,3 @@ 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:
|