gitlab-styles 3.2.0 → 5.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/.editorconfig +18 -0
  3. data/.gitignore +3 -1
  4. data/.gitlab-ci.yml +25 -4
  5. data/.gitlab/merge_request_templates/Release.md +35 -0
  6. data/.rubocop.yml +3 -1
  7. data/Gemfile +5 -2
  8. data/README.md +5 -0
  9. data/Rakefile +2 -0
  10. data/gitlab-styles.gemspec +8 -5
  11. data/lib/gitlab/styles.rb +2 -0
  12. data/lib/gitlab/styles/rubocop.rb +7 -0
  13. data/lib/gitlab/styles/rubocop/cop/active_record_dependent.rb +4 -2
  14. data/lib/gitlab/styles/rubocop/cop/active_record_serialize.rb +3 -1
  15. data/lib/gitlab/styles/rubocop/cop/code_reuse/active_record.rb +131 -0
  16. data/lib/gitlab/styles/rubocop/cop/custom_error_class.rb +9 -4
  17. data/lib/gitlab/styles/rubocop/cop/gem_fetcher.rb +4 -2
  18. data/lib/gitlab/styles/rubocop/cop/in_batches.rb +3 -1
  19. data/lib/gitlab/styles/rubocop/cop/line_break_after_guard_clauses.rb +4 -2
  20. data/lib/gitlab/styles/rubocop/cop/line_break_around_conditional_block.rb +132 -0
  21. data/lib/gitlab/styles/rubocop/cop/migration/update_large_table.rb +64 -0
  22. data/lib/gitlab/styles/rubocop/cop/polymorphic_associations.rb +4 -2
  23. data/lib/gitlab/styles/rubocop/cop/redirect_with_status.rb +3 -1
  24. data/lib/gitlab/styles/rubocop/cop/rspec/base.rb +18 -0
  25. data/lib/gitlab/styles/rubocop/cop/rspec/empty_line_after_let_block.rb +65 -0
  26. data/lib/gitlab/styles/rubocop/cop/rspec/empty_line_after_shared_example.rb +65 -0
  27. data/lib/gitlab/styles/rubocop/cop/rspec/have_link_parameters.rb +13 -6
  28. data/lib/gitlab/styles/rubocop/cop/rspec/single_line_hook.rb +6 -3
  29. data/lib/gitlab/styles/rubocop/cop/rspec/verbose_include_metadata.rb +13 -14
  30. data/lib/gitlab/styles/rubocop/cop/without_reactive_cache.rb +3 -1
  31. data/lib/gitlab/styles/rubocop/migration_helpers.rb +2 -0
  32. data/lib/gitlab/styles/rubocop/model_helpers.rb +3 -1
  33. data/lib/gitlab/styles/rubocop/rspec/helpers.rb +17 -0
  34. data/lib/gitlab/styles/version.rb +3 -1
  35. data/rubocop-all.yml +2 -1
  36. data/rubocop-bundler.yml +1 -0
  37. data/rubocop-code_reuse.yml +24 -0
  38. data/rubocop-default.yml +2 -0
  39. data/rubocop-gemspec.yml +1 -0
  40. data/rubocop-layout.yml +38 -22
  41. data/rubocop-lint.yml +81 -19
  42. data/rubocop-metrics.yml +1 -4
  43. data/rubocop-migrations.yml +22 -0
  44. data/rubocop-naming.yml +9 -8
  45. data/rubocop-performance.yml +48 -0
  46. data/rubocop-rails.yml +79 -0
  47. data/rubocop-rspec.yml +14 -0
  48. data/rubocop-security.yml +1 -0
  49. data/rubocop-style.yml +119 -15
  50. metadata +27 -17
  51. data/.rubocop_todo.yml +0 -7
@@ -1,4 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rubocop-rspec'
4
+ require_relative 'base'
2
5
 
3
6
  module Gitlab
4
7
  module Styles
@@ -21,8 +24,8 @@ module Gitlab
21
24
  # after(:each) do
22
25
  # undo_something
23
26
  # end
24
- class SingleLineHook < RuboCop::Cop::RSpec::Cop
25
- MESSAGE = "Don't use single-line hook blocks.".freeze
27
+ class SingleLineHook < Base
28
+ MESSAGE = "Don't use single-line hook blocks."
26
29
 
27
30
  def_node_search :rspec_hook?, <<~PATTERN
28
31
  (send nil? {:after :around :before} ...)
@@ -32,7 +35,7 @@ module Gitlab
32
35
  return unless node.single_line?
33
36
  return unless rspec_hook?(node)
34
37
 
35
- add_offense(node, location: :expression, message: MESSAGE)
38
+ add_offense(node, message: MESSAGE)
36
39
  end
37
40
  end
38
41
  end
@@ -1,4 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rubocop-rspec'
4
+ require_relative 'base'
2
5
 
3
6
  module Gitlab
4
7
  module Styles
@@ -15,8 +18,10 @@ module Gitlab
15
18
  # # good
16
19
  # describe MyClass, :js do
17
20
  # end
18
- class VerboseIncludeMetadata < RuboCop::Cop::RSpec::Cop
19
- MSG = 'Use `%s` instead of `%s`.'.freeze
21
+ class VerboseIncludeMetadata < Base
22
+ extend RuboCop::Cop::AutoCorrector
23
+
24
+ MSG = 'Use `%s` instead of `%s`.'
20
25
 
21
26
  SELECTORS = %i[describe context feature example_group it specify example scenario its].freeze
22
27
 
@@ -35,25 +40,19 @@ module Gitlab
35
40
 
36
41
  def on_send(node)
37
42
  invalid_metadata_matches(node) do |match|
38
- add_offense(node, location: :expression, message: format(MSG, good(match), bad(match)))
39
- end
40
- end
41
-
42
- def autocorrect(node)
43
- lambda do |corrector|
44
- invalid_metadata_matches(node) do |match|
45
- corrector.replace(match.loc.expression, good(match))
43
+ add_offense(node, message: format(MSG, good(match), bad(match))) do |corrector|
44
+ invalid_metadata_matches(node) do |match|
45
+ corrector.replace(match.loc.expression, good(match))
46
+ end
46
47
  end
47
48
  end
48
49
  end
49
50
 
50
51
  private
51
52
 
52
- def invalid_metadata_matches(node)
53
+ def invalid_metadata_matches(node, &block)
53
54
  include_metadata(node) do |matches|
54
- matches.select(&method(:invalid_metadata?)).each do |match|
55
- yield match
56
- end
55
+ matches.select(&method(:invalid_metadata?)).each(&block)
57
56
  end
58
57
  end
59
58
 
@@ -1,10 +1,12 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Gitlab
2
4
  module Styles
3
5
  module Rubocop
4
6
  module Cop
5
7
  # Cop that prevents the use of `without_reactive_cache`
6
8
  class WithoutReactiveCache < RuboCop::Cop::Cop
7
- MSG = 'without_reactive_cache is for debugging purposes only. Please use with_reactive_cache.'.freeze
9
+ MSG = 'without_reactive_cache is for debugging purposes only. Please use with_reactive_cache.'
8
10
 
9
11
  def on_send(node)
10
12
  return unless node.children[1] == :without_reactive_cache
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Gitlab
2
4
  module Styles
3
5
  module Rubocop
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Gitlab
2
4
  module Styles
3
5
  module Rubocop
@@ -5,7 +7,7 @@ module Gitlab
5
7
  # Returns true if the given node originated from the models directory.
6
8
  def in_model?(node)
7
9
  path = node.location.expression.source_buffer.name
8
- pwd = RuboCop::PathUtil.pwd
10
+ pwd = Dir.pwd
9
11
  models_path = File.join(pwd, 'app', 'models')
10
12
  ee_models_path = File.join(pwd, 'ee', 'app', 'models')
11
13
 
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'rubocop-rspec'
4
+
5
+ module Gitlab
6
+ module Styles
7
+ module Rubocop
8
+ module Rspec
9
+ module Helpers
10
+ include RuboCop::RSpec::Language
11
+
12
+ LET = SelectorSet.new(%i[let_it_be]) + RuboCop::RSpec::Language::Helpers::ALL
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -1,5 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Gitlab
2
4
  module Styles
3
- VERSION = '3.2.0'.freeze
5
+ VERSION = '5.1.0'
4
6
  end
5
7
  end
@@ -1,5 +1,6 @@
1
+ ---
1
2
  AllCops:
2
- TargetRubyVersion: 2.3
3
+ TargetRubyVersion: 2.6
3
4
  # Cop names are not displayed in offense messages by default. Change behavior
4
5
  # by overriding DisplayCopNames, or by giving the -D/--display-cop-names
5
6
  # option.
@@ -1,3 +1,4 @@
1
+ ---
1
2
  # Gems in consecutive lines should be alphabetically sorted
2
3
  Bundler/OrderedGems:
3
4
  Enabled: false
@@ -0,0 +1,24 @@
1
+ # Denies the use of ActiveRecord methods outside of configured
2
+ # excluded directories
3
+ # Directories that allow the use of the denied methods.
4
+ # To start we provide a default configuration that matches
5
+ # a standard Rails app and enable.
6
+ # The default configuration can be overridden by
7
+ # providing your own Exclusion list as follows:
8
+ # CodeReuse/ActiveRecord:
9
+ # Enabled: true
10
+ # Exclude:
11
+ # - app/models/**/*.rb
12
+ # - config/**/*.rb
13
+ # - db/**/*.rb
14
+ # - lib/tasks/**/*.rb
15
+ # - spec/**/*.rb
16
+ # - lib/gitlab/**/*.rb
17
+ CodeReuse/ActiveRecord:
18
+ Enabled: true
19
+ Exclude:
20
+ - app/models/**/*.rb
21
+ - config/**/*.rb
22
+ - db/**/*.rb
23
+ - lib/tasks/**/*.rb
24
+ - spec/**/*.rb
@@ -1,3 +1,4 @@
1
+ ---
1
2
  require:
2
3
  - rubocop-gitlab-security
3
4
  - rubocop-performance
@@ -12,6 +13,7 @@ inherit_from:
12
13
  - rubocop-layout.yml
13
14
  - rubocop-lint.yml
14
15
  - rubocop-metrics.yml
16
+ - rubocop-migrations.yml
15
17
  - rubocop-naming.yml
16
18
  - rubocop-performance.yml
17
19
  - rubocop-rails.yml
@@ -1,3 +1,4 @@
1
+ ---
1
2
  # Dependencies in the gemspec should be alphabetically sorted
2
3
  # Configuration parameters: Include, TreatCommentsAsGroupSeparators.
3
4
  Gemspec/OrderedDependencies:
@@ -1,20 +1,17 @@
1
+ ---
1
2
  # Check indentation of private/protected visibility modifiers.
2
3
  Layout/AccessModifierIndentation:
3
4
  Enabled: true
4
5
 
5
6
  # Align the elements of an array literal if they span more than one line.
6
- Layout/AlignArray:
7
+ Layout/ArrayAlignment:
7
8
  Enabled: true
8
9
 
9
- # Align the elements of a hash literal if they span more than one line.
10
- Layout/AlignHash:
10
+ # Checks the indentation of the first line of the right-hand-side of a
11
+ # multi-line assignment.
12
+ Layout/AssignmentIndentation:
11
13
  Enabled: true
12
14
 
13
- # Here we check if the parameters on a multi-line method call or
14
- # definition are aligned.
15
- Layout/AlignParameters:
16
- Enabled: false
17
-
18
15
  # Align block ends correctly.
19
16
  Layout/BlockAlignment:
20
17
  Enabled: true
@@ -64,6 +61,11 @@ Layout/EmptyLines:
64
61
  Layout/EmptyLinesAroundAccessModifier:
65
62
  Enabled: true
66
63
 
64
+ # Checks for a newline after an attribute accessor or a group of them
65
+ # https://docs.rubocop.org/rubocop/0.89/cops_layout.html#layoutemptylinesaroundattributeaccessor
66
+ Layout/EmptyLinesAroundAttributeAccessor:
67
+ Enabled: true
68
+
67
69
  # Keeps track of empty lines around block bodies.
68
70
  Layout/EmptyLinesAroundBlockBody:
69
71
  Enabled: true
@@ -102,27 +104,36 @@ Layout/ExtraSpacing:
102
104
  Layout/FirstMethodParameterLineBreak:
103
105
  Enabled: true
104
106
 
107
+ # Align the elements of a hash literal if they span more than one line.
108
+ Layout/HashAlignment:
109
+ Enabled: true
110
+
111
+ # This cops checks the indentation of the here document bodies.
112
+ Layout/HeredocIndentation:
113
+ Enabled: false
114
+
105
115
  # Keep indentation straight.
106
116
  Layout/IndentationConsistency:
107
117
  Enabled: true
108
118
 
109
- # Use 2 spaces for indentation.
110
- Layout/IndentationWidth:
119
+ # No hard tabs.
120
+ Layout/IndentationStyle:
111
121
  Enabled: true
112
122
 
113
- # Checks the indentation of the first line of the right-hand-side of a
114
- # multi-line assignment.
115
- Layout/IndentAssignment:
123
+ # Use 2 spaces for indentation.
124
+ Layout/IndentationWidth:
116
125
  Enabled: true
117
126
 
118
- # This cops checks the indentation of the here document bodies.
119
- Layout/IndentHeredoc:
120
- Enabled: false
121
-
122
127
  # Comments should start with a space.
123
128
  Layout/LeadingCommentSpace:
124
129
  Enabled: true
125
130
 
131
+ # Limit lines to 120 characters.
132
+ Layout/LineLength:
133
+ Enabled: true
134
+ Max: 120
135
+ IgnoredPatterns: ['\s#\srubocop']
136
+
126
137
  # Checks that the closing brace in an array literal is either on the same line
127
138
  # as the last array element, or a new line.
128
139
  Layout/MultilineArrayBraceLayout:
@@ -160,6 +171,11 @@ Layout/MultilineOperationIndentation:
160
171
  Enabled: true
161
172
  EnforcedStyle: indented
162
173
 
174
+ # Here we check if the parameters on a multi-line method call or
175
+ # definition are aligned.
176
+ Layout/ParameterAlignment:
177
+ Enabled: false
178
+
163
179
  # Use spaces after colons.
164
180
  Layout/SpaceAfterColon:
165
181
  Enabled: true
@@ -189,6 +205,10 @@ Layout/SpaceAroundEqualsInParameterDefault:
189
205
  Layout/SpaceAroundKeyword:
190
206
  Enabled: true
191
207
 
208
+ # Checks method call operators to not have spaces around them.
209
+ Layout/SpaceAroundMethodCallOperator:
210
+ Enabled: true
211
+
192
212
  # Use a single space around operators.
193
213
  Layout/SpaceAroundOperators:
194
214
  Enabled: true
@@ -235,12 +255,8 @@ Layout/SpaceInsideStringInterpolation:
235
255
  EnforcedStyle: no_space
236
256
  Enabled: true
237
257
 
238
- # No hard tabs.
239
- Layout/Tab:
240
- Enabled: true
241
-
242
258
  # Checks trailing blank lines and final newline.
243
- Layout/TrailingBlankLines:
259
+ Layout/TrailingEmptyLines:
244
260
  Enabled: true
245
261
 
246
262
  # Avoid trailing whitespace.
@@ -1,3 +1,4 @@
1
+ ---
1
2
  # Checks for ambiguous block association with method when param passed without
2
3
  # parentheses.
3
4
  Lint/AmbiguousBlockAssociation:
@@ -18,6 +19,10 @@ Lint/AmbiguousRegexpLiteral:
18
19
  Lint/AssignmentInCondition:
19
20
  Enabled: false
20
21
 
22
+ # Checks for places where binary operator has identical operands
23
+ Lint/BinaryOperatorWithIdenticalOperands:
24
+ Enabled: true
25
+
21
26
  # Default values in optional keyword arguments and optional ordinal arguments
22
27
  # should not refer back to the name of the argument.
23
28
  Lint/CircularArgumentReference:
@@ -31,6 +36,22 @@ Lint/Debugger:
31
36
  Lint/DeprecatedClassMethods:
32
37
  Enabled: true
33
38
 
39
+ # Algorithmic constants for OpenSSL::Cipher and OpenSSL::Digest deprecated since OpenSSL version 2.2.0.
40
+ # Prefer passing a string instead.
41
+ # https://docs.rubocop.org/rubocop/0.89/cops_lint.html#lintdeprecatedopensslconstant
42
+ Lint/DeprecatedOpenSSLConstant:
43
+ Enabled: true
44
+
45
+ # Checks that there are no repeated conditions used in if 'elsif'.
46
+ # https://docs.rubocop.org/rubocop/0.89/cops_lint.html#lintduplicateelsifcondition
47
+ Lint/DuplicateElsifCondition:
48
+ Enabled: true
49
+
50
+ # Checks that there are no repeated exceptions used in 'rescue' expressions.
51
+ # https://docs.rubocop.org/rubocop/0.89/cops_lint.html#lintduplicaterescueexception
52
+ Lint/DuplicateRescueException:
53
+ Enabled: true
54
+
34
55
  # Check for immutable argument given to each_with_object.
35
56
  Lint/EachWithObjectArgument:
36
57
  Enabled: true
@@ -39,6 +60,11 @@ Lint/EachWithObjectArgument:
39
60
  Lint/ElseLayout:
40
61
  Enabled: true
41
62
 
63
+ # Checks for the presence of if, elsif and unless branches without a body.
64
+ # https://docs.rubocop.org/rubocop/0.89/cops_lint.html#lintemptyconditionalbody
65
+ Lint/EmptyConditionalBody:
66
+ Enabled: true
67
+
42
68
  # Checks for empty ensure block.
43
69
  Lint/EmptyEnsure:
44
70
  Enabled: true
@@ -47,10 +73,6 @@ Lint/EmptyEnsure:
47
73
  Lint/EmptyWhen:
48
74
  Enabled: true
49
75
 
50
- # END blocks should not be placed inside method definitions.
51
- Lint/EndInMethod:
52
- Enabled: true
53
-
54
76
  # Do not use return in an ensure block.
55
77
  Lint/EnsureReturn:
56
78
  Enabled: true
@@ -59,6 +81,11 @@ Lint/EnsureReturn:
59
81
  Lint/FlipFlop:
60
82
  Enabled: true
61
83
 
84
+ # Checks for the presence of precise comparison of floating point numbers.
85
+ # https://docs.rubocop.org/rubocop/0.89/cops_lint.html#lintfloatcomparison
86
+ Lint/FloatComparison:
87
+ Enabled: true
88
+
62
89
  # Catches floating-point literals too large or small for Ruby to represent.
63
90
  Lint/FloatOutOfRange:
64
91
  Enabled: true
@@ -67,10 +94,6 @@ Lint/FloatOutOfRange:
67
94
  Lint/FormatParameterMismatch:
68
95
  Enabled: true
69
96
 
70
- # This cop checks for *rescue* blocks with no body.
71
- Lint/HandleExceptions:
72
- Enabled: false
73
-
74
97
  # Checks for adjacent string literals on the same line, which could better be
75
98
  # represented as a single string literal.
76
99
  Lint/ImplicitStringConcatenation:
@@ -89,10 +112,21 @@ Lint/LiteralAsCondition:
89
112
  Lint/LiteralInInterpolation:
90
113
  Enabled: true
91
114
 
92
- # This cop checks for uses of *begin...end while/until something*.
115
+ # Checks for uses of *begin...end while/until something*.
93
116
  Lint/Loop:
94
117
  Enabled: false
95
118
 
119
+ # Checks for the presence of constructors and lifecycle callbacks without calls to super.
120
+ # https://docs.rubocop.org/rubocop/0.89/cops_lint.html#lintmissingsuper
121
+ Lint/MissingSuper:
122
+ Enabled: false
123
+
124
+ # Do not mix named captures and numbered captures in a Regexp literal
125
+ # because numbered capture is ignored if they’re mixed.
126
+ # https://docs.rubocop.org/rubocop/0.89/cops_lint.html#lintmixedregexpcapturetypes
127
+ Lint/MixedRegexpCaptureTypes:
128
+ Enabled: true
129
+
96
130
  # Do not use nested method definitions.
97
131
  Lint/NestedMethodDefinition:
98
132
  Enabled: true
@@ -101,15 +135,32 @@ Lint/NestedMethodDefinition:
101
135
  Lint/NextWithoutAccumulator:
102
136
  Enabled: true
103
137
 
138
+ # Looks for references of Regexp captures that are out of range and thus always returns nil.
139
+ # https://docs.rubocop.org/rubocop/0.89/cops_lint.html#lintoutofrangeregexpref
140
+ Lint/OutOfRangeRegexpRef:
141
+ Enabled: true
142
+
104
143
  # Checks for method calls with a space before the opening parenthesis.
105
144
  Lint/ParenthesesAsGroupedExpression:
106
145
  Enabled: true
107
146
 
147
+ # Checks for raise or fail statements which are raising Exception class.
148
+ Lint/RaiseException:
149
+ Enabled: true
150
+
108
151
  # Checks for `rand(1)` calls. Such calls always return `0` and most likely
109
152
  # a mistake.
110
153
  Lint/RandOne:
111
154
  Enabled: true
112
155
 
156
+ # This cop checks for unneeded usages of splat expansion
157
+ Lint/RedundantSplatExpansion:
158
+ Enabled: false
159
+
160
+ # Checks for Object#to_s usage in string interpolation.
161
+ Lint/RedundantStringCoercion:
162
+ Enabled: true
163
+
113
164
  # Use parentheses in the method call to avoid confusion about precedence.
114
165
  Lint/RequireParentheses:
115
166
  Enabled: true
@@ -122,6 +173,11 @@ Lint/RescueException:
122
173
  Lint/SafeNavigationWithEmpty:
123
174
  Enabled: true
124
175
 
176
+ # Checks for self-assignments.
177
+ # https://docs.rubocop.org/rubocop/0.89/cops_lint.html#lintselfassignment
178
+ Lint/SelfAssignment:
179
+ Enabled: true
180
+
125
181
  # Checks for the order which exceptions are rescued to avoid rescueing a less specific exception before a more specific exception.
126
182
  Lint/ShadowedException:
127
183
  Enabled: false
@@ -131,8 +187,17 @@ Lint/ShadowedException:
131
187
  Lint/ShadowingOuterLocalVariable:
132
188
  Enabled: false
133
189
 
134
- # Checks for Object#to_s usage in string interpolation.
135
- Lint/StringConversionInInterpolation:
190
+ # Checks unexpected overrides of the Struct built-in methods via Struct.new.
191
+ Lint/StructNewOverride:
192
+ Enabled: true
193
+
194
+ # This cop checks for *rescue* blocks with no body.
195
+ Lint/SuppressedException:
196
+ Enabled: false
197
+
198
+ # Checks for top level return with arguments.
199
+ # https://docs.rubocop.org/rubocop/0.89/cops_lint.html#linttoplevelreturnwithargument
200
+ Lint/TopLevelReturnWithArgument:
136
201
  Enabled: true
137
202
 
138
203
  # Do not use prefix `_` for a variable that is used.
@@ -143,14 +208,15 @@ Lint/UnderscorePrefixedVariableName:
143
208
  Lint/UnifiedInteger:
144
209
  Enabled: true
145
210
 
146
- # This cop checks for unneeded usages of splat expansion
147
- Lint/UnneededSplatExpansion:
148
- Enabled: false
149
-
150
211
  # Unreachable code.
151
212
  Lint/UnreachableCode:
152
213
  Enabled: true
153
214
 
215
+ # Checks for loops that will have at most one iteration.
216
+ # https://docs.rubocop.org/rubocop/0.89/cops_lint.html#lintunreachableloop
217
+ Lint/UnreachableLoop:
218
+ Enabled: true
219
+
154
220
  # This cop checks for unused block arguments.
155
221
  Lint/UnusedBlockArgument:
156
222
  Enabled: false
@@ -168,10 +234,6 @@ Lint/UselessAccessModifier:
168
234
  Lint/UselessAssignment:
169
235
  Enabled: true
170
236
 
171
- # Checks for comparison of something with itself.
172
- Lint/UselessComparison:
173
- Enabled: true
174
-
175
237
  # Checks for useless `else` in `begin..end` without `rescue`.
176
238
  Lint/UselessElseWithoutRescue:
177
239
  Enabled: true