rubocop-style.yml in gitlab-styles-10.1.0 vs rubocop-style.yml in gitlab-styles-11.0.0
- old
+ new
@@ -50,14 +50,18 @@
# Do not use block comments.
Style/BlockComments:
Enabled: true
-# Avoid using {...} for multi-line blocks (multiline chaining is # always
-# ugly). Prefer {...} over do...end for single-line blocks.
+# Avoid using {...} for multi-line blocks (multi-line chaining is always ugly).
+# Prefer {...} over do...end for single-line blocks.
Style/BlockDelimiters:
Enabled: true
+ # Do flag `it {` in multi-line blocks. Off by default.
+ AllowedMethods:
+ - proc
+ - lambda
# Checks for uses of the case equality operator(===).
Style/CaseEquality:
Enabled: false
@@ -125,15 +129,14 @@
# Favor the use of Fixnum#even? && Fixnum#odd?
Style/EvenOdd:
Enabled: true
-# Enforces the use of explicit block argument to avoid writing block literal that
-# just passes its arguments to another block.
-# https://docs.rubocop.org/rubocop/0.89/cops_style.html#styleexplicitblockargument
+# Reason: Using `yield` is ~20% faster than `&block`.
+# See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/94090#note_1452639709
Style/ExplicitBlockArgument:
- Enabled: true
+ Enabled: false
# Enforces consistency when using exponential notation for numbers in the code
Style/ExponentialNotation:
Enabled: true
@@ -305,9 +308,14 @@
Enabled: false
# Add underscores to large numeric literals to improve their readability.
Style/NumericLiterals:
Enabled: false
+
+
+# Enforces the use Object#then instead of Object#yield_self.
+Style/ObjectThen:
+ Enabled: true
# Favor the ternary operator(?:) over if/then/else/end constructs.
Style/OneLineConditional:
Enabled: true