foodcritic 11.1.0 → 11.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +14 -1
- data/README.md +18 -0
- data/chef_dsl_metadata/{chef_12.8.1.json → chef_13.1.31.json} +4377 -1784
- data/features/009_check_for_unrecognised_resource_attributes.feature +0 -9
- data/features/038_check_for_invalid_action.feature +0 -9
- data/features/step_definitions/cookbook_steps.rb +6 -124
- data/lib/foodcritic/command_line.rb +1 -1
- data/lib/foodcritic/linter.rb +1 -1
- data/lib/foodcritic/rules/fc091.rb +10 -0
- data/lib/foodcritic/rules/fc092.rb +10 -0
- data/lib/foodcritic/version.rb +1 -1
- data/spec/functional/fc008_spec.rb +6 -6
- data/spec/functional/fc009_spec.rb +27 -0
- data/spec/functional/fc010_spec.rb +32 -0
- data/spec/functional/fc011_spec.rb +3 -3
- data/spec/functional/fc012_spec.rb +3 -3
- data/spec/functional/fc013_spec.rb +4 -4
- data/spec/functional/fc015_spec.rb +19 -0
- data/spec/functional/fc016_spec.rb +5 -5
- data/spec/functional/fc028_spec.rb +18 -18
- data/spec/functional/fc029_spec.rb +6 -6
- data/spec/functional/fc031_spec.rb +2 -2
- data/spec/functional/fc038_spec.rb +23 -0
- data/spec/functional/fc042_spec.rb +2 -2
- data/spec/functional/fc043_spec.rb +28 -0
- data/spec/functional/fc045_spec.rb +3 -3
- data/spec/functional/fc052_spec.rb +2 -2
- data/spec/functional/fc053_spec.rb +2 -2
- data/spec/functional/fc055_spec.rb +3 -3
- data/spec/functional/fc056_spec.rb +3 -3
- data/spec/functional/fc057_spec.rb +62 -0
- data/spec/functional/fc058_spec.rb +102 -0
- data/spec/functional/fc059_spec.rb +27 -0
- data/spec/functional/fc060_spec.rb +45 -0
- data/spec/functional/fc061_spec.rb +9 -9
- data/spec/functional/fc062_spec.rb +2 -2
- data/spec/functional/fc063_spec.rb +3 -3
- data/spec/functional/fc064_spec.rb +2 -2
- data/spec/functional/fc065_spec.rb +2 -2
- data/spec/functional/fc066_spec.rb +6 -6
- data/spec/functional/fc067_spec.rb +2 -2
- data/spec/functional/fc068_spec.rb +2 -2
- data/spec/functional/fc069_spec.rb +5 -5
- data/spec/functional/fc070_spec.rb +9 -9
- data/spec/functional/fc071_spec.rb +6 -6
- data/spec/functional/fc072_spec.rb +2 -2
- data/spec/functional/fc073_spec.rb +9 -9
- data/spec/functional/fc074_spec.rb +3 -3
- data/spec/functional/fc075_spec.rb +5 -5
- data/spec/functional/fc091_spec.rb +38 -0
- data/spec/functional/fc092_spec.rb +31 -0
- data/spec/regression/expected/aix.txt +1 -0
- data/spec/regression/expected/build-essential.txt +1 -0
- data/spec/regression/expected/drbd.txt +1 -0
- data/spec/regression/expected/perl.txt +1 -0
- data/spec/regression/expected/sudo.txt +1 -0
- data/spec/regression/expected/users.txt +1 -0
- data/spec/spec_helper.rb +8 -0
- data/spec/unit/linter_spec.rb +1 -1
- metadata +18 -14
- data/chef_dsl_metadata/chef_12.6.0.json +0 -15760
- data/chef_dsl_metadata/chef_12.7.2.json +0 -16673
- data/features/010_check_search_syntax.feature +0 -20
- data/features/015_check_for_definitions.feature +0 -20
- data/features/043_check_for_old_notification_style.feature +0 -28
- data/features/057_check_for_library_provider_without_use_inline_resources.feature +0 -20
- data/features/058_check_for_library_provider_bad_action_methods.feature +0 -25
- data/features/059_check_for_lwrp_provider_without_use_inline_resources.feature +0 -15
- data/features/060_check_for_lwrp_provider_bad_action_methods.feature +0 -25
@@ -1,20 +0,0 @@
|
|
1
|
-
Feature: Check for invalid search syntax
|
2
|
-
|
3
|
-
In order to identify invalid search syntax that will cause my converge to fail
|
4
|
-
As a developer
|
5
|
-
I want to verify that search expressions use valid Lucene syntax
|
6
|
-
|
7
|
-
Scenario: Invalid search syntax
|
8
|
-
Given a cookbook recipe that attempts to perform a search with invalid syntax
|
9
|
-
When I check the cookbook
|
10
|
-
Then the invalid search syntax warning 010 should be displayed
|
11
|
-
|
12
|
-
Scenario: Valid search syntax
|
13
|
-
Given a cookbook recipe that attempts to perform a search with valid syntax
|
14
|
-
When I check the cookbook
|
15
|
-
Then the invalid search syntax warning 010 should not be displayed
|
16
|
-
|
17
|
-
Scenario: Search with subexpression
|
18
|
-
Given a cookbook recipe that attempts to perform a search with a subexpression
|
19
|
-
When I check the cookbook
|
20
|
-
Then the invalid search syntax warning 010 should not be displayed
|
@@ -1,20 +0,0 @@
|
|
1
|
-
Feature: Check for use of definitions
|
2
|
-
|
3
|
-
In order to benefit from the additional features supported by first-class resources
|
4
|
-
As a developer
|
5
|
-
I want to identify when definitions are being used so they can be refactored to become Custom Resources
|
6
|
-
|
7
|
-
Scenario: Cookbook contains definition
|
8
|
-
Given a cookbook that contains a definition
|
9
|
-
When I check the cookbook
|
10
|
-
Then the definitions are deprecated warning 015 should be displayed against the definition file
|
11
|
-
|
12
|
-
Scenario: Cookbook does not contain a definition - no directory
|
13
|
-
Given a cookbook that does not contain a definition and has no definitions directory
|
14
|
-
When I check the cookbook
|
15
|
-
Then the definitions are deprecated warning 015 should not be displayed against the definition file
|
16
|
-
|
17
|
-
Scenario: Cookbook does not contain a definition - directory
|
18
|
-
Given a cookbook that does not contain a definition and has a definitions directory
|
19
|
-
When I check the cookbook
|
20
|
-
Then the definitions are deprecated warning 015 should not be displayed against the definition file
|
@@ -1,28 +0,0 @@
|
|
1
|
-
Feature: Check for old notification style
|
2
|
-
|
3
|
-
In order to be able to notify a resource that has not yet been declared
|
4
|
-
As a developer
|
5
|
-
I want to use the new-style notification syntax
|
6
|
-
|
7
|
-
Scenario: No notification
|
8
|
-
Given a cookbook recipe with no notifications
|
9
|
-
When I check the cookbook
|
10
|
-
Then the prefer new notification syntax warning 043 should not be displayed
|
11
|
-
|
12
|
-
Scenario: New-style notification
|
13
|
-
Given a cookbook recipe with a resource that notifies a service to restart
|
14
|
-
When I check the cookbook
|
15
|
-
Then the prefer new notification syntax warning 043 should not be displayed
|
16
|
-
|
17
|
-
Scenario: Old-style notification
|
18
|
-
Given a cookbook recipe with a resource that uses the old notification syntax
|
19
|
-
When I check the cookbook
|
20
|
-
Then the prefer new notification syntax warning 043 should be displayed
|
21
|
-
|
22
|
-
Scenario Outline: Applicability by Chef version
|
23
|
-
Given a cookbook recipe with a resource that uses the old notification syntax
|
24
|
-
When I check the cookbook specifying <version> as the Chef version
|
25
|
-
Then the prefer new notification syntax warning 043 <displayed> be displayed
|
26
|
-
Examples:
|
27
|
-
| version | displayed |
|
28
|
-
| 11.4.0 | should |
|
@@ -1,20 +0,0 @@
|
|
1
|
-
Feature: Check for library providers that do not declare use_inline_resources
|
2
|
-
|
3
|
-
In order to ensure that notifications happen correctly
|
4
|
-
As a cookbook provider author
|
5
|
-
I want to always use_inline_resources
|
6
|
-
|
7
|
-
Scenario: Library provider with use_inline_resources
|
8
|
-
Given a cookbook that contains a library provider with use_inline_resources
|
9
|
-
When I check the cookbook
|
10
|
-
Then the library provider without use_inline_resources warning 057 should not be displayed against the libraries file
|
11
|
-
|
12
|
-
Scenario: Library provider without use_inline_resources
|
13
|
-
Given a cookbook that contains a library provider without use_inline_resources
|
14
|
-
When I check the cookbook
|
15
|
-
Then the library provider without use_inline_resources warning 057 should be displayed against the libraries file on line 11
|
16
|
-
|
17
|
-
Scenario: Library file without use_inline_resources
|
18
|
-
Given a cookbook that contains a library resource
|
19
|
-
When I check the cookbook
|
20
|
-
Then the library provider without use_inline_resources warning 057 should not be displayed against the libraries file
|
@@ -1,25 +0,0 @@
|
|
1
|
-
Feature: Check for library providers that declare use_inline_resources and declare action_<name> methods
|
2
|
-
|
3
|
-
In order to ensure that notifications happen correctly
|
4
|
-
As a cookbook provider author
|
5
|
-
I want to always use_inline_resources
|
6
|
-
|
7
|
-
Scenario: Library provider with use_inline_resources and bad action_create
|
8
|
-
Given a cookbook that contains a library provider with use_inline_resources and uses def action_create
|
9
|
-
When I check the cookbook
|
10
|
-
Then the library provider without use_inline_resources and bad action_create warning 058 should be displayed against the libraries file on line 11
|
11
|
-
|
12
|
-
Scenario: Library provider without use_inline_resources and (okay) action_create
|
13
|
-
Given a cookbook that contains a library provider without use_inline_resources and uses def action_create
|
14
|
-
When I check the cookbook
|
15
|
-
Then the library provider without use_inline_resources and bad action_create warning 058 should not be displayed against the libraries file on any line
|
16
|
-
|
17
|
-
Scenario: Library provider without use_inline_resources
|
18
|
-
Given a cookbook that contains a library provider without use_inline_resources
|
19
|
-
When I check the cookbook
|
20
|
-
Then the library provider without use_inline_resources and bad action_create warning 058 should not be displayed against the libraries file on any line
|
21
|
-
|
22
|
-
Scenario: Library provider with use_inline_resources
|
23
|
-
Given a cookbook that contains a library provider with use_inline_resources
|
24
|
-
When I check the cookbook
|
25
|
-
Then the library provider without use_inline_resources and bad action_create warning 058 should not be displayed against the libraries file on any line
|
@@ -1,15 +0,0 @@
|
|
1
|
-
Feature: Check for LWRP providers that do not declare use_inline_resources
|
2
|
-
|
3
|
-
In order to ensure that notifications happen correctly
|
4
|
-
As a cookbook provider author
|
5
|
-
I want to always use_inline_resources
|
6
|
-
|
7
|
-
Scenario: LWRP provider with use_inline_resources
|
8
|
-
Given a cookbook that contains a LWRP provider with use_inline_resources
|
9
|
-
When I check the cookbook
|
10
|
-
Then the LWRP provider without use_inline_resources warning 059 should not be displayed against the provider file
|
11
|
-
|
12
|
-
Scenario: LWRP provider without use_inline_resources
|
13
|
-
Given a cookbook that contains a LWRP provider without use_inline_resources
|
14
|
-
When I check the cookbook
|
15
|
-
Then the LWRP provider without use_inline_resources warning 059 should be displayed against the provider file
|
@@ -1,25 +0,0 @@
|
|
1
|
-
Feature: Check for LWRP providers that declare use_inline_resources and declare action_<name> methods
|
2
|
-
|
3
|
-
In order to ensure that notifications happen correctly
|
4
|
-
As a cookbook provider author
|
5
|
-
I want to always use_inline_resources
|
6
|
-
|
7
|
-
Scenario: LWRP provider with use_inline_resources and bad action_create
|
8
|
-
Given a cookbook that contains a LWRP provider with use_inline_resources and uses def action_create
|
9
|
-
When I check the cookbook
|
10
|
-
Then the LWRP provider without use_inline_resources and bad action_create warning 060 should be displayed against the provider file on line 3
|
11
|
-
|
12
|
-
Scenario: LWRP provider without use_inline_resources
|
13
|
-
Given a cookbook that contains a LWRP provider without use_inline_resources
|
14
|
-
When I check the cookbook
|
15
|
-
Then the LWRP provider without use_inline_resources and bad action_create warning 060 should not be displayed against the provider file
|
16
|
-
|
17
|
-
Scenario: LWRP provider without use_inline_resources and (okay) action_create
|
18
|
-
Given a cookbook that contains a LWRP provider without use_inline_resources and uses def action_create
|
19
|
-
When I check the cookbook
|
20
|
-
Then the LWRP provider without use_inline_resources and bad action_create warning 060 should not be displayed against the provider file
|
21
|
-
|
22
|
-
Scenario: LWRP provider with use_inline_resources
|
23
|
-
Given a cookbook that contains a LWRP provider with use_inline_resources
|
24
|
-
When I check the cookbook
|
25
|
-
Then the LWRP provider without use_inline_resources and bad action_create warning 060 should not be displayed against the provider file
|