config/default.yml in rubocop-0.67.2 vs config/default.yml in rubocop-0.68.0
- old
+ new
@@ -217,10 +217,38 @@
- indent
# By default, the indentation width from Layout/IndentationWidth is used
# But it can be overridden by setting this parameter
IndentationWidth: ~
+Layout/AlignArguments:
+ Description: >-
+ Align the arguments of a method call if they span more
+ than one line.
+ StyleGuide: '#no-double-indent'
+ Enabled: true
+ VersionAdded: '0.68'
+ # Alignment of arguments in multi-line method calls.
+ #
+ # The `with_first_argument` style aligns the following lines along the same
+ # column as the first parameter.
+ #
+ # method_call(a,
+ # b)
+ #
+ # The `with_fixed_indentation` style aligns the following lines with one
+ # level of indentation relative to the start of the line with the method call.
+ #
+ # method_call(a,
+ # b)
+ EnforcedStyle: with_first_argument
+ SupportedStyles:
+ - with_first_argument
+ - with_fixed_indentation
+ # By default, the indentation width from Layout/IndentationWidth is used
+ # But it can be overridden by setting this parameter
+ IndentationWidth: ~
+
Layout/AlignArray:
Description: >-
Align the elements of an array literal if they span more than
one line.
StyleGuide: '#align-multiline-arrays'
@@ -303,27 +331,28 @@
- ignore_implicit
- ignore_explicit
Layout/AlignParameters:
Description: >-
- Align the parameters of a method call if they span more
+ Align the parameters of a method definition if they span more
than one line.
StyleGuide: '#no-double-indent'
Enabled: true
VersionAdded: '0.49'
+ VersionChanged: '0.68'
# Alignment of parameters in multi-line method calls.
#
# The `with_first_parameter` style aligns the following lines along the same
# column as the first parameter.
#
- # method_call(a,
- # b)
+ # def method_foo(a,
+ # b)
#
# The `with_fixed_indentation` style aligns the following lines with one
# level of indentation relative to the start of the line with the method call.
#
- # method_call(a,
+ # def method_foo(a,
# b)
EnforcedStyle: with_first_parameter
SupportedStyles:
- with_first_parameter
- with_fixed_indentation
@@ -614,15 +643,31 @@
Checks for a line break before the first parameter in a
multi-line method parameter definition.
Enabled: false
VersionAdded: '0.49'
-Layout/FirstParameterIndentation:
- Description: 'Checks the indentation of the first parameter in a method call.'
+Layout/HeredocArgumentClosingParenthesis:
+ Description: >-
+ Checks for the placement of the closing parenthesis in a
+ method call that passes a HEREDOC string as an argument.
+ Enabled: false
+ VersionAdded: '0.68'
+
+Layout/IndentAssignment:
+ Description: >-
+ Checks the indentation of the first line of the
+ right-hand-side of a multi-line assignment.
Enabled: true
VersionAdded: '0.49'
- VersionChanged: '0.56'
+ # By default, the indentation width from `Layout/IndentationWidth` is used
+ # But it can be overridden by setting this parameter
+ IndentationWidth: ~
+
+Layout/IndentFirstArgument:
+ Description: 'Checks the indentation of the first argument in a method call.'
+ Enabled: true
+ VersionAdded: '0.68'
EnforcedStyle: special_for_inner_method_call_in_parentheses
SupportedStyles:
# The first parameter should always be indented one step more than the
# preceding line.
- consistent
@@ -639,16 +684,16 @@
- special_for_inner_method_call_in_parentheses
# By default, the indentation width from `Layout/IndentationWidth` is used
# But it can be overridden by setting this parameter
IndentationWidth: ~
-Layout/IndentArray:
+Layout/IndentFirstArrayElement:
Description: >-
Checks the indentation of the first element in an array
literal.
Enabled: true
- VersionAdded: '0.49'
+ VersionAdded: '0.68'
# The value `special_inside_parentheses` means that array literals with
# brackets that have their opening bracket on the same line as a surrounding
# opening round parenthesis, shall have their first element indented relative
# to the first position inside the parenthesis.
#
@@ -665,24 +710,14 @@
- align_brackets
# By default, the indentation width from `Layout/IndentationWidth` is used
# But it can be overridden by setting this parameter
IndentationWidth: ~
-Layout/IndentAssignment:
- Description: >-
- Checks the indentation of the first line of the
- right-hand-side of a multi-line assignment.
- Enabled: true
- VersionAdded: '0.49'
- # By default, the indentation width from `Layout/IndentationWidth` is used
- # But it can be overridden by setting this parameter
- IndentationWidth: ~
-
-Layout/IndentHash:
+Layout/IndentFirstHashElement:
Description: 'Checks the indentation of the first key in a hash literal.'
Enabled: true
- VersionAdded: '0.49'
+ VersionAdded: '0.68'
# The value `special_inside_parentheses` means that hash literals with braces
# that have their opening brace on the same line as a surrounding opening
# round parenthesis, shall have their first key indented relative to the
# first position inside the parenthesis.
#
@@ -699,10 +734,25 @@
- align_braces
# By default, the indentation width from `Layout/IndentationWidth` is used
# But it can be overridden by setting this parameter
IndentationWidth: ~
+Layout/IndentFirstParameter:
+ Description: >-
+ Checks the indentation of the first parameter in a
+ method definition.
+ Enabled: true
+ VersionAdded: '0.49'
+ VersionChanged: '0.68'
+ EnforcedStyle: special_for_inner_method_call_in_parentheses
+ SupportedStyles:
+ - consistent
+ - align_parentheses
+ # By default, the indentation width from `Layout/IndentationWidth` is used
+ # But it can be overridden by setting this parameter
+ IndentationWidth: ~
+
Layout/IndentHeredoc:
Description: 'This cop checks the indentation of the here document bodies.'
StyleGuide: '#squiggly-heredocs'
Enabled: true
VersionAdded: '0.49'
@@ -1308,10 +1358,17 @@
Description: "Don't suppress exception."
StyleGuide: '#dont-hide-exceptions'
Enabled: true
VersionAdded: '0.9'
+Lint/HeredocMethodCallPosition:
+ Description: >-
+ Checks for the ordering of a method call where
+ the receiver of the call is a HEREDOC.
+ Enabled: false
+ VersionAdded: '0.68'
+
Lint/ImplicitStringConcatenation:
Description: >-
Checks for adjacent string literals on the same line, which
could better be represented as a single string literal.
Enabled: true
@@ -1555,10 +1612,11 @@
Lint/UnderscorePrefixedVariableName:
Description: 'Do not use prefix `_` for a variable that is used.'
Enabled: true
VersionAdded: '0.21'
+ AllowKeywordBlockArguments: false
Lint/UnifiedInteger:
Description: 'Use Integer instead of Fixnum or Bignum'
Enabled: true
VersionAdded: '0.43'
@@ -1718,11 +1776,12 @@
Metrics/LineLength:
Description: 'Limit lines to 80 characters.'
StyleGuide: '#80-character-limits'
Enabled: true
VersionAdded: '0.25'
- VersionChanged: '0.46'
+ VersionChanged: '0.68'
+ AutoCorrect: false
Max: 80
# To make it possible to copy or click on URIs in the code, we allow lines
# containing a URI to be longer than Max.
AllowHeredoc: true
AllowURI: true
@@ -1937,10 +1996,11 @@
Naming/RescuedExceptionsVariableName:
Description: 'Use consistent rescued exceptions variables naming.'
Enabled: true
VersionAdded: '0.67'
+ VersionChanged: '0.68'
PreferredName: e
Naming/UncommunicativeBlockParamName:
Description: >-
Checks for block parameter names that contain capital letters,
@@ -1998,220 +2058,10 @@
SupportedStyles:
- snake_case
- normalcase
- non_integer
-#################### Performance ###########################
-
-Performance/Caller:
- Description: >-
- Use `caller(n..n)` instead of `caller`.
- Enabled: true
- VersionAdded: '0.49'
-
-Performance/CaseWhenSplat:
- Description: >-
- Reordering `when` conditions with a splat to the end
- of the `when` branches can improve performance.
- Enabled: false
- AutoCorrect: false
- SafeAutoCorrect: false
- VersionAdded: '0.34'
- VersionChanged: '0.59'
-
-Performance/Casecmp:
- Description: >-
- Use `casecmp` rather than `downcase ==`, `upcase ==`, `== downcase`, or `== upcase`..
- Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringcasecmp-vs-stringdowncase---code'
- Enabled: true
- VersionAdded: '0.36'
-
-Performance/ChainArrayAllocation:
- Description: >-
- Instead of chaining array methods that allocate new arrays, mutate an
- existing array.
- Reference: 'https://twitter.com/schneems/status/1034123879978029057'
- Enabled: false
- VersionAdded: '0.59'
-
-Performance/CompareWithBlock:
- Description: 'Use `sort_by(&:foo)` instead of `sort { |a, b| a.foo <=> b.foo }`.'
- Enabled: true
- VersionAdded: '0.46'
-
-Performance/Count:
- Description: >-
- Use `count` instead of `select...size`, `reject...size`,
- `select...count`, `reject...count`, `select...length`,
- and `reject...length`.
- # This cop has known compatibility issues with `ActiveRecord` and other
- # frameworks. ActiveRecord's `count` ignores the block that is passed to it.
- # For more information, see the documentation in the cop itself.
- # If you understand the known risk, you can disable `SafeMode`.
- SafeMode: true
- Enabled: true
- VersionAdded: '0.31'
- VersionChanged: '0.39'
-
-Performance/Detect:
- Description: >-
- Use `detect` instead of `select.first`, `find_all.first`,
- `select.last`, and `find_all.last`.
- Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerabledetect-vs-enumerableselectfirst-code'
- # This cop has known compatibility issues with `ActiveRecord` and other
- # frameworks. `ActiveRecord` does not implement a `detect` method and `find`
- # has its own meaning. Correcting `ActiveRecord` methods with this cop
- # should be considered unsafe.
- SafeMode: true
- Enabled: true
- VersionAdded: '0.30'
- VersionChanged: '0.39'
-
-Performance/DoubleStartEndWith:
- Description: >-
- Use `str.{start,end}_with?(x, ..., y, ...)`
- instead of `str.{start,end}_with?(x, ...) || str.{start,end}_with?(y, ...)`.
- Enabled: true
- VersionAdded: '0.36'
- VersionChanged: '0.48'
- # Used to check for `starts_with?` and `ends_with?`.
- # These methods are defined by `ActiveSupport`.
- IncludeActiveSupportAliases: false
-
-Performance/EndWith:
- Description: 'Use `end_with?` instead of a regex match anchored to the end of a string.'
- Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringmatch-vs-stringstart_withstringend_with-code-start-code-end'
- # This will change to a new method call which isn't guaranteed to be on the
- # object. Switching these methods has to be done with knowledge of the types
- # of the variables which rubocop doesn't have.
- SafeAutoCorrect: false
- AutoCorrect: false
- Enabled: true
- VersionAdded: '0.36'
- VersionChanged: '0.44'
-
-Performance/FixedSize:
- Description: 'Do not compute the size of statically sized objects except in constants'
- Enabled: true
- VersionAdded: '0.35'
-
-Performance/FlatMap:
- Description: >-
- Use `Enumerable#flat_map`
- instead of `Enumerable#map...Array#flatten(1)`
- or `Enumberable#collect..Array#flatten(1)`
- Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablemaparrayflatten-vs-enumerableflat_map-code'
- Enabled: true
- VersionAdded: '0.30'
- EnabledForFlattenWithoutParams: false
- # If enabled, this cop will warn about usages of
- # `flatten` being called without any parameters.
- # This can be dangerous since `flat_map` will only flatten 1 level, and
- # `flatten` without any parameters can flatten multiple levels.
-
-Performance/InefficientHashSearch:
- Description: 'Use `key?` or `value?` instead of `keys.include?` or `values.include?`'
- Reference: 'https://github.com/JuanitoFatas/fast-ruby#hashkey-instead-of-hashkeysinclude-code'
- Enabled: true
- VersionAdded: '0.56'
- Safe: false
-
-Performance/OpenStruct:
- Description: 'Use `Struct` instead of `OpenStruct`.'
- Enabled: false
- VersionAdded: '0.61'
- Safe: false
-
-Performance/RangeInclude:
- Description: 'Use `Range#cover?` instead of `Range#include?`.'
- Reference: 'https://github.com/JuanitoFatas/fast-ruby#cover-vs-include-code'
- Enabled: true
- VersionAdded: '0.36'
- Safe: false
-
-Performance/RedundantBlockCall:
- Description: 'Use `yield` instead of `block.call`.'
- Reference: 'https://github.com/JuanitoFatas/fast-ruby#proccall-and-block-arguments-vs-yieldcode'
- Enabled: true
- VersionAdded: '0.36'
-
-Performance/RedundantMatch:
- Description: >-
- Use `=~` instead of `String#match` or `Regexp#match` in a context where the
- returned `MatchData` is not needed.
- Enabled: true
- VersionAdded: '0.36'
-
-Performance/RedundantMerge:
- Description: 'Use Hash#[]=, rather than Hash#merge! with a single key-value pair.'
- Reference: 'https://github.com/JuanitoFatas/fast-ruby#hashmerge-vs-hash-code'
- Enabled: true
- VersionAdded: '0.36'
- # Max number of key-value pairs to consider an offense
- MaxKeyValuePairs: 2
-
-Performance/RegexpMatch:
- Description: >-
- Use `match?` instead of `Regexp#match`, `String#match`, `Symbol#match`,
- `Regexp#===`, or `=~` when `MatchData` is not used.
- Reference: 'https://github.com/JuanitoFatas/fast-ruby#regexp-vs-stringmatch-vs-string-vs-stringmatch-code-'
- Enabled: true
- VersionAdded: '0.47'
-
-Performance/ReverseEach:
- Description: 'Use `reverse_each` instead of `reverse.each`.'
- Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablereverseeach-vs-enumerablereverse_each-code'
- Enabled: true
- VersionAdded: '0.30'
-
-Performance/Size:
- Description: >-
- Use `size` instead of `count` for counting
- the number of elements in `Array` and `Hash`.
- Reference: 'https://github.com/JuanitoFatas/fast-ruby#arraylength-vs-arraysize-vs-arraycount-code'
- Enabled: true
- VersionAdded: '0.30'
-
-Performance/StartWith:
- Description: 'Use `start_with?` instead of a regex match anchored to the beginning of a string.'
- Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringmatch-vs-stringstart_withstringend_with-code-start-code-end'
- # This will change to a new method call which isn't guaranteed to be on the
- # object. Switching these methods has to be done with knowledge of the types
- # of the variables which rubocop doesn't have.
- SafeAutoCorrect: false
- AutoCorrect: false
- Enabled: true
- VersionAdded: '0.36'
- VersionChanged: '0.44'
-
-Performance/StringReplacement:
- Description: >-
- Use `tr` instead of `gsub` when you are replacing the same
- number of characters. Use `delete` instead of `gsub` when
- you are deleting characters.
- Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringgsub-vs-stringtr-code'
- Enabled: true
- VersionAdded: '0.33'
-
-Performance/TimesMap:
- Description: 'Checks for .times.map calls.'
- AutoCorrect: false
- Enabled: true
- VersionAdded: '0.36'
- VersionChanged: '0.50'
- SafeAutoCorrect: false # see https://github.com/rubocop-hq/rubocop/issues/4658
-
-Performance/UnfreezeString:
- Description: 'Use unary plus to get an unfrozen string literal.'
- Enabled: true
- VersionAdded: '0.50'
-
-Performance/UriDefaultParser:
- Description: 'Use `URI::DEFAULT_PARSER` instead of `URI::Parser.new`.'
- Enabled: true
- VersionAdded: '0.50'
-
#################### Rails #################################
# By default, the rails cops are not run. Override in project or home
# directory .rubocop.yml files, or by giving the -R/--rails option.
Rails:
@@ -2622,12 +2472,13 @@
Rails/TimeZone:
Description: 'Checks the correct usage of time zone aware methods.'
StyleGuide: 'https://github.com/rubocop-hq/rails-style-guide#time'
Reference: 'http://danilenko.org/2012/7/6/rails_timezones'
Enabled: true
+ Safe: false
VersionAdded: '0.30'
- VersionChanged: '0.33'
+ VersionChanged: '0.68'
# The value `strict` means that `Time` should be used with `zone`.
# The value `flexible` allows usage of `in_time_zone` instead of `zone`.
EnforcedStyle: flexible
SupportedStyles:
- strict
@@ -2817,9 +2668,11 @@
# The `braces_for_chaining` style enforces braces around single line blocks
# and do..end around multi-line blocks, except for multi-line blocks whose
# return value is being chained with another method (in which case braces
# are enforced).
- braces_for_chaining
+ # The `always_braces` style always enforces braces.
+ - always_braces
ProceduralMethods:
# Methods that are known to be procedural in nature but look functional from
# their usage, e.g.
#
# time = Benchmark.realtime do