foodcritic 2.1.0 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +691 -0
- data/LICENSE +21 -0
- data/README.md +28 -0
- data/chef_dsl_metadata/chef_0.10.10.json +22 -0
- data/chef_dsl_metadata/chef_10.12.0.json +22 -0
- data/chef_dsl_metadata/chef_10.14.0.json +22 -0
- data/chef_dsl_metadata/chef_10.14.2.json +22 -0
- data/chef_dsl_metadata/chef_10.14.4.json +22 -0
- data/chef_dsl_metadata/chef_10.16.0.json +22 -0
- data/chef_dsl_metadata/chef_10.16.2.json +22 -0
- data/chef_dsl_metadata/chef_10.16.4.json +22 -0
- data/chef_dsl_metadata/chef_10.16.6.json +22 -0
- data/chef_dsl_metadata/chef_10.18.0.json +22 -0
- data/chef_dsl_metadata/chef_10.18.2.json +22 -0
- data/chef_dsl_metadata/chef_10.20.0.json +22 -0
- data/chef_dsl_metadata/chef_10.22.0.json +22 -0
- data/chef_dsl_metadata/chef_10.24.0.json +22 -0
- data/chef_dsl_metadata/chef_10.24.4.json +8460 -0
- data/chef_dsl_metadata/chef_10.26.0.json +8460 -0
- data/chef_dsl_metadata/chef_11.0.0.json +22 -0
- data/chef_dsl_metadata/chef_11.2.0.json +22 -0
- data/chef_dsl_metadata/chef_11.4.0.json +22 -0
- data/chef_dsl_metadata/chef_11.4.2.json +8794 -0
- data/chef_dsl_metadata/chef_11.4.4.json +8794 -0
- data/features/002_check_string_interpolation.feature +45 -0
- data/features/003_check_for_chef_server.feature +56 -0
- data/features/004_check_service_resource_used.feature +53 -0
- data/features/005_check_for_resource_repetition.feature +64 -0
- data/features/006_check_file_mode.feature +35 -0
- data/features/007_check_for_undeclared_recipe_dependencies.feature +71 -0
- data/features/008_check_for_boilerplate_metadata.feature +25 -0
- data/features/009_check_for_unrecognised_resource_attributes.feature +77 -0
- data/features/010_check_search_syntax.feature +20 -0
- data/features/011_check_for_markdown_readme.feature +20 -0
- data/features/012_check_for_deprecated_readme_format.feature +20 -0
- data/features/013_check_for_hardcoded_tmpdir.feature +25 -0
- data/features/014_check_for_long_ruby_blocks.feature +30 -0
- data/features/015_check_for_definitions.feature +21 -0
- data/features/016_check_for_no_lwrp_default_action.feature +20 -0
- data/features/017_check_for_no_lwrp_notifications.feature +25 -0
- data/features/018_check_for_old_lwrp_notification_syntax.feature +25 -0
- data/features/019_check_for_consistent_node_access.feature +107 -0
- data/features/021_check_for_dodgy_lwrp_conditions.feature +28 -0
- data/features/022_check_for_dodgy_conditions_within_loop.feature +28 -0
- data/features/023_check_for_condition_around_resource.feature +52 -0
- data/features/024_check_for_missing_platforms.feature +43 -0
- data/features/025_check_for_deprecated_gem_install.feature +30 -0
- data/features/026_check_for_conditional_block_string.feature +20 -0
- data/features/027_check_for_internal_attribute_use.feature +22 -0
- data/features/028_check_for_incorrect_platform_method.feature +20 -0
- data/features/029_check_for_no_leading_cookbook_name.feature +18 -0
- data/features/030_check_for_debugger_breakpoints.feature +25 -0
- data/features/031_check_for_metadata_existence.feature +15 -0
- data/features/032_check_for_invalid_notification_timing.feature +22 -0
- data/features/033_check_for_missing_template.feature +75 -0
- data/features/034_check_for_unused_template_variables.feature +37 -0
- data/features/037_check_for_invalid_notification_action.feature +34 -0
- data/features/038_check_for_invalid_action.feature +51 -0
- data/features/039_check_for_key_access_to_node_methods.feature +33 -0
- data/features/040_check_raw_git_usage.feature +37 -0
- data/features/041_check_raw_download.feature +26 -0
- data/features/042_check_for_deprecated_require_recipe.feature +15 -0
- data/features/043_check_for_old_notification_style.feature +35 -0
- data/features/044_check_for_bare_attribute_keys.feature +43 -0
- data/features/045_check_for_cookbook_name_in_metadata.feature +20 -0
- data/features/046_check_for_assign_unless_nil_attributes.feature +21 -0
- data/features/build_framework_support.feature +99 -0
- data/features/checking_all_types_of_file.feature +40 -0
- data/features/choose_rules_to_apply.feature +49 -0
- data/features/command_line_help.feature +43 -0
- data/features/continuous_integration_support.feature +35 -0
- data/features/ignore_via_line_comments.feature +51 -0
- data/features/include_custom_rules.feature +29 -0
- data/features/individual_file.feature +12 -0
- data/features/limit_rules_to_specific_versions.feature +65 -0
- data/features/multiple_paths.feature +11 -0
- data/features/show_lines_matched.feature +20 -0
- data/features/sort_warnings.feature +10 -0
- data/features/specify_search_grammar.feature +25 -0
- data/features/step_definitions/cookbook_steps.rb +1791 -0
- data/features/support/command_helpers.rb +312 -0
- data/features/support/cookbook_helpers.rb +495 -0
- data/features/support/env.rb +11 -0
- data/lib/foodcritic.rb +0 -1
- data/lib/foodcritic/api.rb +3 -2
- data/lib/foodcritic/command_line.rb +4 -0
- data/lib/foodcritic/linter.rb +29 -6
- data/lib/foodcritic/output.rb +74 -26
- data/lib/foodcritic/rules.rb +6 -5
- data/lib/foodcritic/version.rb +1 -1
- data/man/foodcritic.1 +58 -0
- data/man/foodcritic.1.ronn +57 -0
- data/spec/foodcritic/api_spec.rb +1615 -0
- data/spec/foodcritic/chef_spec.rb +66 -0
- data/spec/foodcritic/command_line_spec.rb +51 -0
- data/spec/foodcritic/domain_spec.rb +24 -0
- data/spec/foodcritic/linter_spec.rb +91 -0
- data/spec/foodcritic/template_spec.rb +49 -0
- data/spec/regression/cookbooks.txt +135 -0
- data/spec/regression/expected-output.txt +443 -0
- data/spec/regression/regression_spec.rb +17 -0
- data/spec/regression_helpers.rb +37 -0
- data/spec/spec_helper.rb +10 -0
- metadata +87 -24
@@ -0,0 +1,17 @@
|
|
1
|
+
require_relative '../regression_helpers'
|
2
|
+
|
3
|
+
describe 'regression test' do
|
4
|
+
|
5
|
+
let(:expected_lint_output) do
|
6
|
+
File.read('spec/regression/expected-output.txt')
|
7
|
+
end
|
8
|
+
|
9
|
+
let(:actual_lint_output) do
|
10
|
+
lint_regression_cookbooks
|
11
|
+
end
|
12
|
+
|
13
|
+
it "should result in the expected matches against a pinned set of cookbooks" do
|
14
|
+
actual_lint_output.must_equal expected_lint_output
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require_relative 'spec_helper'
|
2
|
+
require 'fileutils'
|
3
|
+
require 'pathname'
|
4
|
+
|
5
|
+
def lint_regression_cookbooks
|
6
|
+
working_dir = Pathname.new('tmp/regression')
|
7
|
+
FileUtils.mkdir_p(working_dir)
|
8
|
+
|
9
|
+
pinned_cookbooks('spec/regression/cookbooks.txt').each do |cbk|
|
10
|
+
clone_cookbook(working_dir, cbk)
|
11
|
+
end
|
12
|
+
|
13
|
+
lint_cookbooks(working_dir)
|
14
|
+
end
|
15
|
+
|
16
|
+
def pinned_cookbooks(path)
|
17
|
+
File.read(path).lines.map do |line|
|
18
|
+
name, ref = line.strip.split(':')
|
19
|
+
{:name => name, :ref => ref}
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def clone_cookbook(clone_path, cbk)
|
24
|
+
target_path = clone_path + cbk[:name]
|
25
|
+
unless Dir.exists?(target_path)
|
26
|
+
%x{git clone -q https://github.com/opscode-cookbooks/#{cbk[:name]}.git #{target_path}}
|
27
|
+
raise 'Unable to clone cookbook' unless $?.success?
|
28
|
+
end
|
29
|
+
%x{cd #{target_path} && git checkout -q #{cbk[:ref]}}
|
30
|
+
raise 'Unable to checkout revision' unless $?.success?
|
31
|
+
end
|
32
|
+
|
33
|
+
def lint_cookbooks(cookbook_path)
|
34
|
+
result = %x{cd #{cookbook_path} && foodcritic .}
|
35
|
+
raise 'Unable to lint' unless $?.success?
|
36
|
+
result
|
37
|
+
end
|
data/spec/spec_helper.rb
ADDED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foodcritic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-07-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: gherkin
|
@@ -43,22 +43,6 @@ dependencies:
|
|
43
43
|
- - ~>
|
44
44
|
- !ruby/object:Gem::Version
|
45
45
|
version: 1.5.4
|
46
|
-
- !ruby/object:Gem::Dependency
|
47
|
-
name: rak
|
48
|
-
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
|
-
requirements:
|
51
|
-
- - ~>
|
52
|
-
- !ruby/object:Gem::Version
|
53
|
-
version: '1.4'
|
54
|
-
type: :runtime
|
55
|
-
prerelease: false
|
56
|
-
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
|
-
requirements:
|
59
|
-
- - ~>
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '1.4'
|
62
46
|
- !ruby/object:Gem::Dependency
|
63
47
|
name: treetop
|
64
48
|
requirement: !ruby/object:Gem::Requirement
|
@@ -96,7 +80,7 @@ dependencies:
|
|
96
80
|
requirement: !ruby/object:Gem::Requirement
|
97
81
|
none: false
|
98
82
|
requirements:
|
99
|
-
- -
|
83
|
+
- - '>='
|
100
84
|
- !ruby/object:Gem::Version
|
101
85
|
version: '0'
|
102
86
|
type: :runtime
|
@@ -104,7 +88,7 @@ dependencies:
|
|
104
88
|
version_requirements: !ruby/object:Gem::Requirement
|
105
89
|
none: false
|
106
90
|
requirements:
|
107
|
-
- -
|
91
|
+
- - '>='
|
108
92
|
- !ruby/object:Gem::Version
|
109
93
|
version: '0'
|
110
94
|
description: Lint tool for Opscode Chef cookbooks.
|
@@ -117,6 +101,7 @@ files:
|
|
117
101
|
- chef_dsl_metadata/chef_10.20.0.json
|
118
102
|
- chef_dsl_metadata/chef_10.12.0.json
|
119
103
|
- chef_dsl_metadata/chef_10.18.2.json
|
104
|
+
- chef_dsl_metadata/chef_10.26.0.json
|
120
105
|
- chef_dsl_metadata/chef_0.10.10.json
|
121
106
|
- chef_dsl_metadata/chef_0.9.4.json
|
122
107
|
- chef_dsl_metadata/chef_0.10.8.json
|
@@ -130,6 +115,7 @@ files:
|
|
130
115
|
- chef_dsl_metadata/chef_0.8.14.json
|
131
116
|
- chef_dsl_metadata/chef_0.9.18.json
|
132
117
|
- chef_dsl_metadata/chef_10.16.0.json
|
118
|
+
- chef_dsl_metadata/chef_11.4.2.json
|
133
119
|
- chef_dsl_metadata/chef_0.9.16.json
|
134
120
|
- chef_dsl_metadata/chef_0.9.2.json
|
135
121
|
- chef_dsl_metadata/chef_0.9.6.json
|
@@ -141,9 +127,11 @@ files:
|
|
141
127
|
- chef_dsl_metadata/chef_0.9.0.json
|
142
128
|
- chef_dsl_metadata/chef_0.8.16.json
|
143
129
|
- chef_dsl_metadata/chef_0.10.4.json
|
130
|
+
- chef_dsl_metadata/chef_11.4.4.json
|
144
131
|
- chef_dsl_metadata/chef_0.10.0.json
|
145
132
|
- chef_dsl_metadata/chef_10.16.2.json
|
146
133
|
- chef_dsl_metadata/chef_10.24.0.json
|
134
|
+
- chef_dsl_metadata/chef_10.24.4.json
|
147
135
|
- chef_dsl_metadata/chef_10.14.2.json
|
148
136
|
- chef_dsl_metadata/chef_10.14.0.json
|
149
137
|
- chef_dsl_metadata/chef_11.2.0.json
|
@@ -165,6 +153,81 @@ files:
|
|
165
153
|
- lib/foodcritic/notifications.rb
|
166
154
|
- lib/foodcritic.rb
|
167
155
|
- bin/foodcritic
|
156
|
+
- spec/spec_helper.rb
|
157
|
+
- spec/regression/regression_spec.rb
|
158
|
+
- spec/regression/expected-output.txt
|
159
|
+
- spec/regression/cookbooks.txt
|
160
|
+
- spec/foodcritic/template_spec.rb
|
161
|
+
- spec/foodcritic/command_line_spec.rb
|
162
|
+
- spec/foodcritic/chef_spec.rb
|
163
|
+
- spec/foodcritic/api_spec.rb
|
164
|
+
- spec/foodcritic/linter_spec.rb
|
165
|
+
- spec/foodcritic/domain_spec.rb
|
166
|
+
- spec/regression_helpers.rb
|
167
|
+
- features/045_check_for_cookbook_name_in_metadata.feature
|
168
|
+
- features/choose_rules_to_apply.feature
|
169
|
+
- features/030_check_for_debugger_breakpoints.feature
|
170
|
+
- features/006_check_file_mode.feature
|
171
|
+
- features/029_check_for_no_leading_cookbook_name.feature
|
172
|
+
- features/include_custom_rules.feature
|
173
|
+
- features/031_check_for_metadata_existence.feature
|
174
|
+
- features/checking_all_types_of_file.feature
|
175
|
+
- features/021_check_for_dodgy_lwrp_conditions.feature
|
176
|
+
- features/015_check_for_definitions.feature
|
177
|
+
- features/041_check_raw_download.feature
|
178
|
+
- features/individual_file.feature
|
179
|
+
- features/multiple_paths.feature
|
180
|
+
- features/007_check_for_undeclared_recipe_dependencies.feature
|
181
|
+
- features/046_check_for_assign_unless_nil_attributes.feature
|
182
|
+
- features/023_check_for_condition_around_resource.feature
|
183
|
+
- features/003_check_for_chef_server.feature
|
184
|
+
- features/018_check_for_old_lwrp_notification_syntax.feature
|
185
|
+
- features/043_check_for_old_notification_style.feature
|
186
|
+
- features/002_check_string_interpolation.feature
|
187
|
+
- features/044_check_for_bare_attribute_keys.feature
|
188
|
+
- features/028_check_for_incorrect_platform_method.feature
|
189
|
+
- features/008_check_for_boilerplate_metadata.feature
|
190
|
+
- features/039_check_for_key_access_to_node_methods.feature
|
191
|
+
- features/026_check_for_conditional_block_string.feature
|
192
|
+
- features/010_check_search_syntax.feature
|
193
|
+
- features/show_lines_matched.feature
|
194
|
+
- features/005_check_for_resource_repetition.feature
|
195
|
+
- features/012_check_for_deprecated_readme_format.feature
|
196
|
+
- features/017_check_for_no_lwrp_notifications.feature
|
197
|
+
- features/support/cookbook_helpers.rb
|
198
|
+
- features/support/env.rb
|
199
|
+
- features/support/command_helpers.rb
|
200
|
+
- features/032_check_for_invalid_notification_timing.feature
|
201
|
+
- features/continuous_integration_support.feature
|
202
|
+
- features/034_check_for_unused_template_variables.feature
|
203
|
+
- features/038_check_for_invalid_action.feature
|
204
|
+
- features/022_check_for_dodgy_conditions_within_loop.feature
|
205
|
+
- features/025_check_for_deprecated_gem_install.feature
|
206
|
+
- features/004_check_service_resource_used.feature
|
207
|
+
- features/sort_warnings.feature
|
208
|
+
- features/limit_rules_to_specific_versions.feature
|
209
|
+
- features/step_definitions/cookbook_steps.rb
|
210
|
+
- features/042_check_for_deprecated_require_recipe.feature
|
211
|
+
- features/024_check_for_missing_platforms.feature
|
212
|
+
- features/command_line_help.feature
|
213
|
+
- features/013_check_for_hardcoded_tmpdir.feature
|
214
|
+
- features/011_check_for_markdown_readme.feature
|
215
|
+
- features/specify_search_grammar.feature
|
216
|
+
- features/019_check_for_consistent_node_access.feature
|
217
|
+
- features/014_check_for_long_ruby_blocks.feature
|
218
|
+
- features/037_check_for_invalid_notification_action.feature
|
219
|
+
- features/ignore_via_line_comments.feature
|
220
|
+
- features/016_check_for_no_lwrp_default_action.feature
|
221
|
+
- features/033_check_for_missing_template.feature
|
222
|
+
- features/040_check_raw_git_usage.feature
|
223
|
+
- features/009_check_for_unrecognised_resource_attributes.feature
|
224
|
+
- features/build_framework_support.feature
|
225
|
+
- features/027_check_for_internal_attribute_use.feature
|
226
|
+
- CHANGELOG.md
|
227
|
+
- README.md
|
228
|
+
- LICENSE
|
229
|
+
- man/foodcritic.1.ronn
|
230
|
+
- man/foodcritic.1
|
168
231
|
homepage: http://acrmp.github.com/foodcritic
|
169
232
|
licenses:
|
170
233
|
- MIT
|
@@ -175,22 +238,22 @@ require_paths:
|
|
175
238
|
required_ruby_version: !ruby/object:Gem::Requirement
|
176
239
|
none: false
|
177
240
|
requirements:
|
178
|
-
- -
|
241
|
+
- - '>='
|
179
242
|
- !ruby/object:Gem::Version
|
180
243
|
version: 1.9.2
|
181
244
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
182
245
|
none: false
|
183
246
|
requirements:
|
184
|
-
- -
|
247
|
+
- - '>='
|
185
248
|
- !ruby/object:Gem::Version
|
186
249
|
version: '0'
|
187
250
|
segments:
|
188
251
|
- 0
|
189
|
-
hash:
|
252
|
+
hash: 2951702180016458639
|
190
253
|
requirements: []
|
191
254
|
rubyforge_project:
|
192
255
|
rubygems_version: 1.8.25
|
193
256
|
signing_key:
|
194
257
|
specification_version: 3
|
195
|
-
summary: foodcritic-2.
|
258
|
+
summary: foodcritic-2.2.0
|
196
259
|
test_files: []
|