cookstyle 6.18.8 → 6.19.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (96) hide show
  1. checksums.yaml +4 -4
  2. data/config/cookstyle.yml +19 -0
  3. data/config/upstream.yml +14 -3
  4. data/lib/cookstyle.rb +0 -3
  5. data/lib/cookstyle/version.rb +2 -2
  6. data/lib/rubocop/cop/chef/correctness/block_guard_clause_string_only.rb +1 -1
  7. data/lib/rubocop/cop/chef/correctness/chef_application_fatal.rb +1 -1
  8. data/lib/rubocop/cop/chef/correctness/conditional_ruby_shellout.rb +1 -1
  9. data/lib/rubocop/cop/chef/correctness/incorrect_library_injection.rb +18 -37
  10. data/lib/rubocop/cop/chef/correctness/invalid_platform_family_values_in_case.rb +1 -1
  11. data/lib/rubocop/cop/chef/correctness/invalid_platform_metadata.rb +2 -2
  12. data/lib/rubocop/cop/chef/correctness/invalid_platform_values_in_case.rb +1 -1
  13. data/lib/rubocop/cop/chef/correctness/lazy_eval_node_attribute_defaults.rb +1 -1
  14. data/lib/rubocop/cop/chef/correctness/lazy_in_resource_guard.rb +1 -1
  15. data/lib/rubocop/cop/chef/correctness/macos_userdefaults_invalid_type.rb +2 -2
  16. data/lib/rubocop/cop/chef/correctness/notifies_action_not_symbol.rb +1 -1
  17. data/lib/rubocop/cop/chef/correctness/resource_with_none_action.rb +1 -1
  18. data/lib/rubocop/cop/chef/correctness/scoped_file_exist.rb +1 -1
  19. data/lib/rubocop/cop/chef/correctness/supports_must_be_float.rb +2 -2
  20. data/lib/rubocop/cop/chef/deprecation/chef_handler_supports.rb +1 -1
  21. data/lib/rubocop/cop/chef/deprecation/chef_rewind.rb +2 -2
  22. data/lib/rubocop/cop/chef/deprecation/chef_shellout.rb +1 -1
  23. data/lib/rubocop/cop/chef/deprecation/chef_windows_platform_helper.rb +1 -1
  24. data/lib/rubocop/cop/chef/deprecation/chefdk_generators.rb +1 -1
  25. data/lib/rubocop/cop/chef/deprecation/chefspec_coverage_report.rb +1 -1
  26. data/lib/rubocop/cop/chef/deprecation/chefspec_legacy_runner.rb +1 -1
  27. data/lib/rubocop/cop/chef/deprecation/deprecated_chefspec_platform.rb +1 -1
  28. data/lib/rubocop/cop/chef/deprecation/deprecated_yum_repository_properties.rb +1 -1
  29. data/lib/rubocop/cop/chef/deprecation/epic_fail.rb +1 -1
  30. data/lib/rubocop/cop/chef/deprecation/execute_path_property.rb +1 -1
  31. data/lib/rubocop/cop/chef/deprecation/execute_relative_creates_without_cwd.rb +1 -1
  32. data/lib/rubocop/cop/chef/deprecation/inherits_compat_resource.rb +1 -1
  33. data/lib/rubocop/cop/chef/deprecation/legacy_notify_syntax.rb +1 -1
  34. data/lib/rubocop/cop/chef/deprecation/node_methods_not_attributes.rb +1 -1
  35. data/lib/rubocop/cop/chef/deprecation/powershell_cookbook_helpers.rb +1 -1
  36. data/lib/rubocop/cop/chef/deprecation/ruby_27_keyword_argument_warnings.rb +2 -2
  37. data/lib/rubocop/cop/chef/deprecation/ruby_block_create_action.rb +2 -2
  38. data/lib/rubocop/cop/chef/deprecation/search_uses_positional_parameters.rb +1 -1
  39. data/lib/rubocop/cop/chef/deprecation/user_supports_property.rb +1 -1
  40. data/lib/rubocop/cop/chef/deprecation/windows_package_installer_type_string.rb +1 -1
  41. data/lib/rubocop/cop/chef/deprecation/windows_task_change_action.rb +2 -2
  42. data/lib/rubocop/cop/chef/deprecation/windows_version_helpers.rb +4 -4
  43. data/lib/rubocop/cop/chef/deprecation/xml_ruby_recipe.rb +1 -1
  44. data/lib/rubocop/cop/chef/effortless/chef_vault_used.rb +89 -0
  45. data/lib/rubocop/cop/chef/effortless/depends_chef_vault.rb +49 -0
  46. data/lib/rubocop/cop/chef/modernize/action_method_in_resource.rb +2 -2
  47. data/lib/rubocop/cop/chef/modernize/berksfile_source.rb +2 -2
  48. data/lib/rubocop/cop/chef/modernize/build_essential.rb +1 -1
  49. data/lib/rubocop/cop/chef/modernize/conditional_using_test.rb +1 -1
  50. data/lib/rubocop/cop/chef/modernize/cron_manage_resource.rb +1 -1
  51. data/lib/rubocop/cop/chef/modernize/databag_helpers.rb +1 -1
  52. data/lib/rubocop/cop/chef/modernize/foodcritic_comments.rb +1 -1
  53. data/lib/rubocop/cop/chef/modernize/if_provides_default_action.rb +1 -1
  54. data/lib/rubocop/cop/chef/modernize/libarchive_file.rb +2 -2
  55. data/lib/rubocop/cop/chef/modernize/macos_user_defaults.rb +1 -1
  56. data/lib/rubocop/cop/chef/modernize/node_init_package.rb +3 -3
  57. data/lib/rubocop/cop/chef/modernize/node_roles_include.rb +1 -1
  58. data/lib/rubocop/cop/chef/modernize/openssl_rsa_key_resource.rb +1 -1
  59. data/lib/rubocop/cop/chef/modernize/openssl_x509_resource.rb +1 -1
  60. data/lib/rubocop/cop/chef/modernize/osx_config_profile_resource.rb +1 -1
  61. data/lib/rubocop/cop/chef/modernize/property_with_name_attribute.rb +1 -1
  62. data/lib/rubocop/cop/chef/modernize/respond_to_compile_time.rb +1 -1
  63. data/lib/rubocop/cop/chef/modernize/respond_to_metadata.rb +5 -5
  64. data/lib/rubocop/cop/chef/modernize/respond_to_provides.rb +1 -1
  65. data/lib/rubocop/cop/chef/modernize/respond_to_resource_name.rb +1 -1
  66. data/lib/rubocop/cop/chef/modernize/shell_out_helper.rb +1 -1
  67. data/lib/rubocop/cop/chef/modernize/simplify_apt_ppa_setup.rb +1 -1
  68. data/lib/rubocop/cop/chef/modernize/sysctl_param_resource.rb +1 -1
  69. data/lib/rubocop/cop/chef/modernize/use_multipackage_installs.rb +1 -1
  70. data/lib/rubocop/cop/chef/modernize/use_require_relative.rb +1 -1
  71. data/lib/rubocop/cop/chef/modernize/zypper_repo.rb +1 -1
  72. data/lib/rubocop/cop/chef/redundant/double_compile_time.rb +1 -1
  73. data/lib/rubocop/cop/chef/redundant/multiple_platform_checks.rb +1 -1
  74. data/lib/rubocop/cop/chef/redundant/ohai_attribute_to_string.rb +1 -1
  75. data/lib/rubocop/cop/chef/redundant/use_create_if_missing.rb +1 -1
  76. data/lib/rubocop/cop/chef/sharing/include_property_descriptions.rb +1 -1
  77. data/lib/rubocop/cop/chef/sharing/insecure_cookbook_url.rb +1 -1
  78. data/lib/rubocop/cop/chef/sharing/invalid_license_string.rb +1 -1
  79. data/lib/rubocop/cop/chef/style/attribute_keys.rb +1 -1
  80. data/lib/rubocop/cop/chef/style/chef_whaaat.rb +1 -1
  81. data/lib/rubocop/cop/chef/style/comment_sentence_spacing.rb +2 -2
  82. data/lib/rubocop/cop/chef/style/comments_copyright_format.rb +2 -2
  83. data/lib/rubocop/cop/chef/style/comments_default_copyright.rb +1 -1
  84. data/lib/rubocop/cop/chef/style/comments_format.rb +6 -13
  85. data/lib/rubocop/cop/chef/style/file_mode.rb +2 -2
  86. data/lib/rubocop/cop/chef/style/immediate_notification_timing.rb +2 -2
  87. data/lib/rubocop/cop/chef/style/include_recipe_with_parentheses.rb +2 -2
  88. data/lib/rubocop/cop/chef/style/negating_only_if.rb +2 -2
  89. data/lib/rubocop/cop/chef/style/overly_complex_supports_depends_metadata.rb +2 -2
  90. data/lib/rubocop/cop/chef/style/simplify_platform_major_version_check.rb +1 -1
  91. data/lib/rubocop/cop/chef/style/true_false_resource_properties.rb +2 -2
  92. data/lib/rubocop/cop/chef/style/unnecessary_os_check.rb +4 -4
  93. data/lib/rubocop/cop/chef/style/unnecessary_platform_case_statement.rb +2 -2
  94. data/lib/rubocop/cop/chef/style/use_platform_helpers.rb +6 -6
  95. metadata +6 -5
  96. data/lib/rubocop/monkey_patches/rescue_ensure_alignment.rb +0 -22
@@ -57,24 +57,24 @@ module RuboCop
57
57
 
58
58
  def on_send(node)
59
59
  platform_equals?(node) do |type, operator, plat|
60
- add_offense(node.loc.expression, message: MSG, severity: :refactor) do |corrector|
60
+ add_offense(node, message: MSG, severity: :refactor) do |corrector|
61
61
  corrected_string = (operator == :!= ? '!' : '') + "#{type.value}?('#{plat.value}')"
62
- corrector.replace(node.loc.expression, corrected_string)
62
+ corrector.replace(node, corrected_string)
63
63
  end
64
64
  end
65
65
 
66
66
  platform_include?(node) do |plats, type|
67
- add_offense(node.loc.expression, message: MSG, severity: :refactor) do |corrector|
67
+ add_offense(node, message: MSG, severity: :refactor) do |corrector|
68
68
  platforms = plats.values.map { |x| x.str_type? ? "'#{x.value}'" : x.source }
69
69
  corrected_string = "#{type.value}?(#{platforms.join(', ')})"
70
- corrector.replace(node.loc.expression, corrected_string)
70
+ corrector.replace(node, corrected_string)
71
71
  end
72
72
  end
73
73
 
74
74
  platform_eql?(node) do |type, plat|
75
- add_offense(node.loc.expression, message: MSG, severity: :refactor) do |corrector|
75
+ add_offense(node, message: MSG, severity: :refactor) do |corrector|
76
76
  corrected_string = "#{type.value}?('#{plat.value}')"
77
- corrector.replace(node.loc.expression, corrected_string)
77
+ corrector.replace(node, corrected_string)
78
78
  end
79
79
  end
80
80
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cookstyle
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.18.8
4
+ version: 6.19.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thom May
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-09-17 00:00:00.000000000 Z
12
+ date: 2020-09-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rubocop
@@ -17,14 +17,14 @@ dependencies:
17
17
  requirements:
18
18
  - - '='
19
19
  - !ruby/object:Gem::Version
20
- version: 0.91.0
20
+ version: 0.92.0
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - '='
26
26
  - !ruby/object:Gem::Version
27
- version: 0.91.0
27
+ version: 0.92.0
28
28
  description:
29
29
  email:
30
30
  - thom@chef.io
@@ -150,7 +150,9 @@ files:
150
150
  - lib/rubocop/cop/chef/deprecation/xml_ruby_recipe.rb
151
151
  - lib/rubocop/cop/chef/deprecation/yum_dnf_compat_recipe.rb
152
152
  - lib/rubocop/cop/chef/effortless/berksfile.rb
153
+ - lib/rubocop/cop/chef/effortless/chef_vault_used.rb
153
154
  - lib/rubocop/cop/chef/effortless/data_bags.rb
155
+ - lib/rubocop/cop/chef/effortless/depends_chef_vault.rb
154
156
  - lib/rubocop/cop/chef/effortless/node_environment.rb
155
157
  - lib/rubocop/cop/chef/effortless/node_policygroup.rb
156
158
  - lib/rubocop/cop/chef/effortless/node_roles.rb
@@ -270,7 +272,6 @@ files:
270
272
  - lib/rubocop/monkey_patches/comment_config.rb
271
273
  - lib/rubocop/monkey_patches/config.rb
272
274
  - lib/rubocop/monkey_patches/registry_cop.rb
273
- - lib/rubocop/monkey_patches/rescue_ensure_alignment.rb
274
275
  - lib/rubocop/monkey_patches/team.rb
275
276
  homepage: https://docs.chef.io/workstation/cookstyle/
276
277
  licenses:
@@ -1,22 +0,0 @@
1
- # frozen_string_literal: true
2
- module RuboCop
3
- module Cop
4
- module Layout
5
- class RescueEnsureAlignment < Base
6
- # @TODO remove this monkeypatch after we upgrade from RuboCop 0.91.0
7
- def begin_end_alignment_style
8
- # FIXME: Workaround for pending status for `Layout/BeginEndAlignment` cop
9
- # When RuboCop 1.0 is released, please replace it with the following condition.
10
- #
11
- # config.for_cop('Layout/BeginEndAlignment')['Enabled'] &&
12
- # config.for_cop('Layout/BeginEndAlignment')['EnforcedStyleAlignWith']
13
- if config.for_all_cops['NewCops'] == 'enable' ||
14
- config.for_cop('Layout/BeginEndAlignment')['Enabled'] &&
15
- config.for_cop('Layout/BeginEndAlignment')['Enabled'] != 'pending'
16
- config.for_cop('Layout/BeginEndAlignment')['EnforcedStyleAlignWith']
17
- end
18
- end
19
- end
20
- end
21
- end
22
- end