cookstyle 6.18.8 → 6.21.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (115) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +5 -1
  3. data/config/cookstyle.yml +39 -0
  4. data/config/disable_all.yml +6 -0
  5. data/config/upstream.yml +44 -3
  6. data/cookstyle.gemspec +1 -1
  7. data/lib/cookstyle.rb +0 -3
  8. data/lib/cookstyle/version.rb +2 -2
  9. data/lib/rubocop/cop/chef/correctness/block_guard_clause_string_only.rb +1 -1
  10. data/lib/rubocop/cop/chef/correctness/chef_application_fatal.rb +2 -1
  11. data/lib/rubocop/cop/chef/correctness/conditional_ruby_shellout.rb +1 -1
  12. data/lib/rubocop/cop/chef/correctness/incorrect_library_injection.rb +19 -37
  13. data/lib/rubocop/cop/chef/correctness/invalid_platform_family_values_in_case.rb +1 -1
  14. data/lib/rubocop/cop/chef/correctness/invalid_platform_metadata.rb +2 -2
  15. data/lib/rubocop/cop/chef/correctness/invalid_platform_values_in_case.rb +2 -1
  16. data/lib/rubocop/cop/chef/correctness/invalid_version_metadata.rb +1 -0
  17. data/lib/rubocop/cop/chef/correctness/lazy_eval_node_attribute_defaults.rb +1 -1
  18. data/lib/rubocop/cop/chef/correctness/lazy_in_resource_guard.rb +1 -1
  19. data/lib/rubocop/cop/chef/correctness/macos_userdefaults_invalid_type.rb +2 -2
  20. data/lib/rubocop/cop/chef/correctness/node_normal.rb +1 -0
  21. data/lib/rubocop/cop/chef/correctness/node_normal_unless.rb +1 -0
  22. data/lib/rubocop/cop/chef/correctness/node_save.rb +1 -0
  23. data/lib/rubocop/cop/chef/correctness/notifies_action_not_symbol.rb +1 -1
  24. data/lib/rubocop/cop/chef/correctness/octal_mode_as_string.rb +48 -0
  25. data/lib/rubocop/cop/chef/correctness/resource_with_none_action.rb +1 -1
  26. data/lib/rubocop/cop/chef/correctness/scoped_file_exist.rb +1 -1
  27. data/lib/rubocop/cop/chef/correctness/supports_must_be_float.rb +2 -2
  28. data/lib/rubocop/cop/chef/deprecation/chef_handler_supports.rb +1 -1
  29. data/lib/rubocop/cop/chef/deprecation/chef_rewind.rb +2 -2
  30. data/lib/rubocop/cop/chef/deprecation/chef_shellout.rb +2 -2
  31. data/lib/rubocop/cop/chef/deprecation/chef_windows_platform_helper.rb +2 -1
  32. data/lib/rubocop/cop/chef/deprecation/chefdk_generators.rb +1 -1
  33. data/lib/rubocop/cop/chef/deprecation/chefspec_coverage_report.rb +1 -1
  34. data/lib/rubocop/cop/chef/deprecation/chefspec_legacy_runner.rb +1 -1
  35. data/lib/rubocop/cop/chef/deprecation/deprecated_chefspec_platform.rb +1 -3
  36. data/lib/rubocop/cop/chef/deprecation/deprecated_platform_methods.rb +1 -0
  37. data/lib/rubocop/cop/chef/deprecation/deprecated_yum_repository_properties.rb +1 -1
  38. data/lib/rubocop/cop/chef/deprecation/epic_fail.rb +1 -1
  39. data/lib/rubocop/cop/chef/deprecation/execute_path_property.rb +1 -1
  40. data/lib/rubocop/cop/chef/deprecation/execute_relative_creates_without_cwd.rb +1 -1
  41. data/lib/rubocop/cop/chef/deprecation/inherits_compat_resource.rb +1 -1
  42. data/lib/rubocop/cop/chef/deprecation/legacy_notify_syntax.rb +2 -2
  43. data/lib/rubocop/cop/chef/deprecation/node_deep_fetch.rb +2 -0
  44. data/lib/rubocop/cop/chef/deprecation/node_methods_not_attributes.rb +22 -27
  45. data/lib/rubocop/cop/chef/deprecation/node_set.rb +1 -0
  46. data/lib/rubocop/cop/chef/deprecation/node_set_unless.rb +1 -0
  47. data/lib/rubocop/cop/chef/deprecation/node_set_without_level.rb +1 -0
  48. data/lib/rubocop/cop/chef/deprecation/partial_search_class_usage.rb +1 -0
  49. data/lib/rubocop/cop/chef/deprecation/powershell_cookbook_helpers.rb +2 -1
  50. data/lib/rubocop/cop/chef/deprecation/resource_overrides_provides_method.rb +2 -2
  51. data/lib/rubocop/cop/chef/deprecation/ruby_27_keyword_argument_warnings.rb +2 -2
  52. data/lib/rubocop/cop/chef/deprecation/ruby_block_create_action.rb +2 -2
  53. data/lib/rubocop/cop/chef/deprecation/search_uses_positional_parameters.rb +1 -1
  54. data/lib/rubocop/cop/chef/deprecation/use_yaml_dump.rb +47 -0
  55. data/lib/rubocop/cop/chef/deprecation/user_supports_property.rb +1 -1
  56. data/lib/rubocop/cop/chef/deprecation/windows_package_installer_type_string.rb +1 -1
  57. data/lib/rubocop/cop/chef/deprecation/windows_task_change_action.rb +2 -2
  58. data/lib/rubocop/cop/chef/deprecation/windows_version_helpers.rb +5 -4
  59. data/lib/rubocop/cop/chef/deprecation/xml_ruby_recipe.rb +1 -1
  60. data/lib/rubocop/cop/chef/effortless/chef_vault_used.rb +89 -0
  61. data/lib/rubocop/cop/chef/effortless/depends_chef_vault.rb +49 -0
  62. data/lib/rubocop/cop/chef/modernize/action_method_in_resource.rb +2 -2
  63. data/lib/rubocop/cop/chef/modernize/berksfile_source.rb +2 -2
  64. data/lib/rubocop/cop/chef/modernize/build_essential.rb +1 -1
  65. data/lib/rubocop/cop/chef/modernize/compile_time_resources.rb +1 -0
  66. data/lib/rubocop/cop/chef/modernize/conditional_using_test.rb +2 -2
  67. data/lib/rubocop/cop/chef/modernize/cron_manage_resource.rb +1 -1
  68. data/lib/rubocop/cop/chef/modernize/databag_helpers.rb +2 -1
  69. data/lib/rubocop/cop/chef/modernize/foodcritic_comments.rb +1 -1
  70. data/lib/rubocop/cop/chef/modernize/if_provides_default_action.rb +1 -1
  71. data/lib/rubocop/cop/chef/modernize/libarchive_file.rb +2 -2
  72. data/lib/rubocop/cop/chef/modernize/macos_user_defaults.rb +1 -1
  73. data/lib/rubocop/cop/chef/modernize/node_init_package.rb +5 -4
  74. data/lib/rubocop/cop/chef/modernize/node_roles_include.rb +2 -1
  75. data/lib/rubocop/cop/chef/modernize/openssl_rsa_key_resource.rb +1 -1
  76. data/lib/rubocop/cop/chef/modernize/openssl_x509_resource.rb +1 -1
  77. data/lib/rubocop/cop/chef/modernize/osx_config_profile_resource.rb +1 -1
  78. data/lib/rubocop/cop/chef/modernize/property_with_name_attribute.rb +1 -1
  79. data/lib/rubocop/cop/chef/modernize/respond_to_compile_time.rb +1 -1
  80. data/lib/rubocop/cop/chef/modernize/respond_to_metadata.rb +6 -6
  81. data/lib/rubocop/cop/chef/modernize/respond_to_provides.rb +10 -10
  82. data/lib/rubocop/cop/chef/modernize/respond_to_resource_name.rb +2 -2
  83. data/lib/rubocop/cop/chef/modernize/shell_out_helper.rb +2 -1
  84. data/lib/rubocop/cop/chef/modernize/simplify_apt_ppa_setup.rb +1 -1
  85. data/lib/rubocop/cop/chef/modernize/sysctl_param_resource.rb +1 -1
  86. data/lib/rubocop/cop/chef/modernize/use_multipackage_installs.rb +1 -1
  87. data/lib/rubocop/cop/chef/modernize/use_require_relative.rb +1 -1
  88. data/lib/rubocop/cop/chef/modernize/zypper_repo.rb +1 -1
  89. data/lib/rubocop/cop/chef/redundant/double_compile_time.rb +2 -1
  90. data/lib/rubocop/cop/chef/redundant/multiple_platform_checks.rb +1 -1
  91. data/lib/rubocop/cop/chef/redundant/name_property_and_required.rb +1 -0
  92. data/lib/rubocop/cop/chef/redundant/ohai_attribute_to_string.rb +2 -1
  93. data/lib/rubocop/cop/chef/redundant/property_splat_regex.rb +1 -0
  94. data/lib/rubocop/cop/chef/redundant/use_create_if_missing.rb +1 -1
  95. data/lib/rubocop/cop/chef/sharing/include_property_descriptions.rb +1 -1
  96. data/lib/rubocop/cop/chef/sharing/insecure_cookbook_url.rb +1 -1
  97. data/lib/rubocop/cop/chef/sharing/invalid_license_string.rb +1 -1
  98. data/lib/rubocop/cop/chef/style/attribute_keys.rb +2 -1
  99. data/lib/rubocop/cop/chef/style/chef_whaaat.rb +1 -1
  100. data/lib/rubocop/cop/chef/style/comment_sentence_spacing.rb +2 -2
  101. data/lib/rubocop/cop/chef/style/comments_copyright_format.rb +2 -2
  102. data/lib/rubocop/cop/chef/style/comments_default_copyright.rb +1 -1
  103. data/lib/rubocop/cop/chef/style/comments_format.rb +6 -13
  104. data/lib/rubocop/cop/chef/style/file_mode.rb +2 -2
  105. data/lib/rubocop/cop/chef/style/immediate_notification_timing.rb +2 -2
  106. data/lib/rubocop/cop/chef/style/include_recipe_with_parentheses.rb +2 -2
  107. data/lib/rubocop/cop/chef/style/negating_only_if.rb +2 -2
  108. data/lib/rubocop/cop/chef/style/overly_complex_supports_depends_metadata.rb +2 -2
  109. data/lib/rubocop/cop/chef/style/simplify_platform_major_version_check.rb +2 -1
  110. data/lib/rubocop/cop/chef/style/true_false_resource_properties.rb +2 -2
  111. data/lib/rubocop/cop/chef/style/unnecessary_os_check.rb +5 -4
  112. data/lib/rubocop/cop/chef/style/unnecessary_platform_case_statement.rb +2 -2
  113. data/lib/rubocop/cop/chef/style/use_platform_helpers.rb +7 -6
  114. metadata +9 -6
  115. data/lib/rubocop/monkey_patches/rescue_ensure_alignment.rb +0 -22
@@ -47,8 +47,8 @@ module RuboCop
47
47
 
48
48
  def on_send(node)
49
49
  immediate_notify?(node) do |timing|
50
- add_offense(timing.loc.expression, message: MSG, severity: :refactor) do |corrector|
51
- corrector.replace(timing.loc.expression, ':immediately')
50
+ add_offense(timing, message: MSG, severity: :refactor) do |corrector|
51
+ corrector.replace(timing, ':immediately')
52
52
  end
53
53
  end
54
54
  end
@@ -47,8 +47,8 @@ module RuboCop
47
47
  # avoid chefspec: expect(chef_run).to include_recipe('foo')
48
48
  return if node.parent&.send_type?
49
49
 
50
- add_offense(node.loc.expression, message: MSG, severity: :refactor) do |corrector|
51
- corrector.replace(node.loc.expression, "include_recipe #{recipe.source}")
50
+ add_offense(node, message: MSG, severity: :refactor) do |corrector|
51
+ corrector.replace(node, "include_recipe #{recipe.source}")
52
52
  end
53
53
  end
54
54
  end
@@ -56,8 +56,8 @@ module RuboCop
56
56
  return if code.descendants.first.send_type? &&
57
57
  code.descendants.first.negation_method?
58
58
 
59
- add_offense(node.loc.expression, message: MSG, severity: :refactor) do |corrector|
60
- corrector.replace(code.loc.expression, code.source.gsub(/^!/, ''))
59
+ add_offense(node, message: MSG, severity: :refactor) do |corrector|
60
+ corrector.replace(code, code.source.gsub(/^!/, ''))
61
61
  corrector.replace(only_if.source_range, 'not_if')
62
62
  end
63
63
  end
@@ -57,9 +57,9 @@ module RuboCop
57
57
  def on_block(node)
58
58
  supports_depends_array?(node) do |array, type|
59
59
  return unless array.values.count < 3
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_value = array.values.map { |x| "#{type} '#{x.source}'" }
62
- corrector.replace(node.loc.expression, corrected_value.join("\n"))
62
+ corrector.replace(node, corrected_value.join("\n"))
63
63
  end
64
64
  end
65
65
  end
@@ -38,6 +38,7 @@ module RuboCop
38
38
  extend AutoCorrector
39
39
 
40
40
  MSG = "Use node['platform_version'].to_i instead of node['platform_version'].split('.').first or node['platform_version'].split('.')[0]"
41
+ RESTRICT_ON_SEND = [:split].freeze
41
42
 
42
43
  def_node_matcher :platform_version_check?, <<-PATTERN
43
44
  (send (send (send nil? :node) :[] (str "platform_version") ) :split (str ".") )
@@ -65,7 +66,7 @@ module RuboCop
65
66
  def add_offense_to_i_if_present(node)
66
67
  node = node.parent if parent_method_equals?(node, :to_i)
67
68
  add_offense(node, message: MSG, severity: :refactor) do |corrector|
68
- corrector.replace(node.loc.expression, "node['platform_version'].to_i")
69
+ corrector.replace(node, "node['platform_version'].to_i")
69
70
  end
70
71
  end
71
72
 
@@ -41,8 +41,8 @@ module RuboCop
41
41
 
42
42
  def on_send(node)
43
43
  trueclass_falseclass_property?(node) do |types|
44
- add_offense(node.loc.expression, message: MSG, severity: :refactor) do |corrector|
45
- corrector.replace(types.loc.expression, '[true, false]')
44
+ add_offense(node, message: MSG, severity: :refactor) do |corrector|
45
+ corrector.replace(types, '[true, false]')
46
46
  end
47
47
  end
48
48
  end
@@ -39,6 +39,7 @@ module RuboCop
39
39
  extend AutoCorrector
40
40
 
41
41
  MSG = "Use the platform_family?() helpers instead of node['os] == 'foo' for platform_families that match 1:1 with OS values."
42
+ RESTRICT_ON_SEND = [:==, :!=, :eql?, :include?].freeze
42
43
 
43
44
  # sorted list of all the os values that match 1:1 with a platform_family
44
45
  UNNECESSARY_OS_VALUES = %w(aix darwin dragonflybsd freebsd netbsd openbsd solaris2 windows).freeze
@@ -58,9 +59,9 @@ module RuboCop
58
59
  def on_send(node)
59
60
  os_equals?(node) do |operator, val|
60
61
  return unless UNNECESSARY_OS_VALUES.include?(val.value)
61
- add_offense(node.loc.expression, message: MSG, severity: :refactor) do |corrector|
62
+ add_offense(node, message: MSG, severity: :refactor) do |corrector|
62
63
  corrected_string = (operator == :!= ? '!' : '') + "platform_family?('#{sanitized_platform(val.value)}')"
63
- corrector.replace(node.loc.expression, corrected_string)
64
+ corrector.replace(node, corrected_string)
64
65
  end
65
66
  end
66
67
 
@@ -68,7 +69,7 @@ module RuboCop
68
69
  return unless UNNECESSARY_OS_VALUES.include?(val.value)
69
70
  add_offense(node, message: MSG, severity: :refactor) do |corrector|
70
71
  corrected_string = "platform_family?('#{sanitized_platform(val.value)}')"
71
- corrector.replace(node.loc.expression, corrected_string)
72
+ corrector.replace(node, corrected_string)
72
73
  end
73
74
  end
74
75
 
@@ -79,7 +80,7 @@ module RuboCop
79
80
  add_offense(node, message: MSG, severity: :refactor) do |corrector|
80
81
  platforms = val.values.map { |x| x.str_type? ? "'#{sanitized_platform(x.value)}'" : x.source }
81
82
  corrected_string = "platform_family?(#{platforms.join(', ')})"
82
- corrector.replace(node.loc.expression, corrected_string)
83
+ corrector.replace(node, corrected_string)
83
84
  end
84
85
  end
85
86
  end
@@ -56,7 +56,7 @@ module RuboCop
56
56
  def on_case(node)
57
57
  platform_case?(node) do |node_, type|
58
58
  return unless node&.when_branches&.count == 1
59
- add_offense(node.loc.expression, message: MSG, severity: :refactor) do |corrector|
59
+ add_offense(node, message: MSG, severity: :refactor) do |corrector|
60
60
  # we have at least one supermarket cookbook with an entirely empty platform case statement
61
61
  # we can't actually fix that so let's do nothing here.
62
62
  unless empty_case_statement?(node)
@@ -66,7 +66,7 @@ module RuboCop
66
66
  # while multi-line statements should just have the case and when bits replace with `if platform?('ubuntu')`
67
67
  if !node.else? && !node.when_branches.first.body.multiline?
68
68
  new_source = "#{node.when_branches.first.body.source} if #{type.value}?(#{condition_string})"
69
- corrector.replace(node.loc.expression, new_source)
69
+ corrector.replace(node, new_source)
70
70
  else
71
71
  # find the range from the beginning of the case to the end of the node['platform'] or node['platform_family']
72
72
  case_range = node.loc.keyword.join(node_.loc.expression.end)
@@ -42,6 +42,7 @@ module RuboCop
42
42
  extend AutoCorrector
43
43
 
44
44
  MSG = "Use platform? and platform_family? helpers to check a node's platform"
45
+ RESTRICT_ON_SEND = [:==, :!=, :eql?, :include?].freeze
45
46
 
46
47
  def_node_matcher :platform_equals?, <<-PATTERN
47
48
  (send (send (send nil? :node) :[] $(str {"platform" "platform_family"}) ) ${:== :!=} $str )
@@ -57,24 +58,24 @@ module RuboCop
57
58
 
58
59
  def on_send(node)
59
60
  platform_equals?(node) do |type, operator, plat|
60
- add_offense(node.loc.expression, message: MSG, severity: :refactor) do |corrector|
61
+ add_offense(node, message: MSG, severity: :refactor) do |corrector|
61
62
  corrected_string = (operator == :!= ? '!' : '') + "#{type.value}?('#{plat.value}')"
62
- corrector.replace(node.loc.expression, corrected_string)
63
+ corrector.replace(node, corrected_string)
63
64
  end
64
65
  end
65
66
 
66
67
  platform_include?(node) do |plats, type|
67
- add_offense(node.loc.expression, message: MSG, severity: :refactor) do |corrector|
68
+ add_offense(node, message: MSG, severity: :refactor) do |corrector|
68
69
  platforms = plats.values.map { |x| x.str_type? ? "'#{x.value}'" : x.source }
69
70
  corrected_string = "#{type.value}?(#{platforms.join(', ')})"
70
- corrector.replace(node.loc.expression, corrected_string)
71
+ corrector.replace(node, corrected_string)
71
72
  end
72
73
  end
73
74
 
74
75
  platform_eql?(node) do |type, plat|
75
- add_offense(node.loc.expression, message: MSG, severity: :refactor) do |corrector|
76
+ add_offense(node, message: MSG, severity: :refactor) do |corrector|
76
77
  corrected_string = "#{type.value}?('#{plat.value}')"
77
- corrector.replace(node.loc.expression, corrected_string)
78
+ corrector.replace(node, corrected_string)
78
79
  end
79
80
  end
80
81
  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.21.1
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-10-15 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.93.1
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.93.1
28
28
  description:
29
29
  email:
30
30
  - thom@chef.io
@@ -74,6 +74,7 @@ files:
74
74
  - lib/rubocop/cop/chef/correctness/node_normal_unless.rb
75
75
  - lib/rubocop/cop/chef/correctness/node_save.rb
76
76
  - lib/rubocop/cop/chef/correctness/notifies_action_not_symbol.rb
77
+ - lib/rubocop/cop/chef/correctness/octal_mode_as_string.rb
77
78
  - lib/rubocop/cop/chef/correctness/openssl_password_helpers.rb
78
79
  - lib/rubocop/cop/chef/correctness/powershell_delete_file.rb
79
80
  - lib/rubocop/cop/chef/correctness/property_without_type.rb
@@ -141,6 +142,7 @@ files:
141
142
  - lib/rubocop/cop/chef/deprecation/run_command_helper.rb
142
143
  - lib/rubocop/cop/chef/deprecation/search_uses_positional_parameters.rb
143
144
  - lib/rubocop/cop/chef/deprecation/use_inline_resources.rb
145
+ - lib/rubocop/cop/chef/deprecation/use_yaml_dump.rb
144
146
  - lib/rubocop/cop/chef/deprecation/user_supports_property.rb
145
147
  - lib/rubocop/cop/chef/deprecation/verify_property_file_expansion.rb
146
148
  - lib/rubocop/cop/chef/deprecation/windows_feature_servermanagercmd.rb
@@ -150,7 +152,9 @@ files:
150
152
  - lib/rubocop/cop/chef/deprecation/xml_ruby_recipe.rb
151
153
  - lib/rubocop/cop/chef/deprecation/yum_dnf_compat_recipe.rb
152
154
  - lib/rubocop/cop/chef/effortless/berksfile.rb
155
+ - lib/rubocop/cop/chef/effortless/chef_vault_used.rb
153
156
  - lib/rubocop/cop/chef/effortless/data_bags.rb
157
+ - lib/rubocop/cop/chef/effortless/depends_chef_vault.rb
154
158
  - lib/rubocop/cop/chef/effortless/node_environment.rb
155
159
  - lib/rubocop/cop/chef/effortless/node_policygroup.rb
156
160
  - lib/rubocop/cop/chef/effortless/node_roles.rb
@@ -270,7 +274,6 @@ files:
270
274
  - lib/rubocop/monkey_patches/comment_config.rb
271
275
  - lib/rubocop/monkey_patches/config.rb
272
276
  - lib/rubocop/monkey_patches/registry_cop.rb
273
- - lib/rubocop/monkey_patches/rescue_ensure_alignment.rb
274
277
  - lib/rubocop/monkey_patches/team.rb
275
278
  homepage: https://docs.chef.io/workstation/cookstyle/
276
279
  licenses:
@@ -279,7 +282,7 @@ metadata:
279
282
  homepage_uri: https://github.com/chef/cookstyle
280
283
  changelog_uri: https://github.com/chef/cookstyle/blob/master/CHANGELOG.md
281
284
  source_code_uri: https://github.com/chef/cookstyle
282
- documentation_uri: https://docs.chef.io/cookstyle.html
285
+ documentation_uri: https://docs.chef.io/workstation/cookstyle/
283
286
  bug_tracker_uri: https://github.com/chef/cookstyle/issues
284
287
  post_install_message:
285
288
  rdoc_options: []
@@ -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