Rubocop v0.84.0 Release Notes

Release Date: 2020-05-21 // 11 days ago
  • 🆕 New features

    • 🚚 #7735: NodePattern and AST classes have been moved to the rubocop-ast gem. (@marcandre)
    • 👕 #7950: Add new Lint/DeprecatedOpenSSLConstant cop. (@bdewater)
    • #7976: Add AllowAliasSyntax and AllowedMethods options for Layout/EmptyLinesAroundAttributeAccessor. (@koic)
    • #7984: New rake task "check_commit" will run rspec and rubocop on files touched by the last commit. (@marcandre)

    🐛 Bug fixes

    • 👕 #7953: Fix an error for Lint/AmbiguousOperator when a method with no arguments is used in advance. (@koic)
    • 👕 #7962: Fix a false positive for Lint/ParenthesesAsGroupedExpression when heredoc has a space between the same string as the method name and (. (@koic)
    • 💅 #7967: Style/SlicingWithRange cop now supports any expression as its first index. (@zverok)
    • 💅 #7972: Fix an incorrect autocrrect for Style/HashSyntax when using a return value uses return. (@koic)
    • 👕 #7886: Fix a bug in AllowComments logic in Lint/SuppressedException. (@jonas054)
    • #7991: Fix an error for Layout/EmptyLinesAroundAttributeAccessor when attribute method is method chained. (@koic)
    • #7993: Fix a false positive for Migration/DepartmentName when a disable comment contains an unexpected character for department name. (@koic)

    🔄 Changes

    • #7952: (Breaking) Change the max line length of Layout/LineLength to 120 by default. (@koic)
    • 💅 #7959: Change enforced style to conditionals for Style/AndOr. (@koic)
    • 💅 #7985: Add EnforcedStyle for Style/DoubleNegation cop and allow double nagation in contexts that use boolean as a return value. (@koic)

Previous changes from v0.83.0

  • 🆕 New features

    • 0️⃣ #7951: Include rakefile file by default. (@jethrodaniel)
    • 💅 #7921: Add new Style/SlicingWithRange cop. (@zverok)
    • 0️⃣ #7895: Include .simplecov file by default. (@robotdana)
    • 👕 #7916: Support autocorrection for Lint/AmbiguousRegexpLiteral. (@koic)
    • 👕 #7917: Support autocorrection for Lint/UselessAccessModifier. (@koic)
    • 🔧 #595: Add ERB pre-processing for configuration files. (@jonas054)
    • 👕 #7918: Support autocorrection for Lint/AmbiguousOperator. (@koic)
    • 💅 #7937: Support autocorrection for Style/IfWithSemicolon. (@koic)
    • 👕 #3696: Add AllowComments option to Lint/EmptyWhen cop. (@koic)
    • 👕 #7910: Support autocorrection for Lint/ParenthesesAsGroupedExpression. (@koic)
    • 👍 #7925: Support autocorrection for Layout/ConditionPosition. (@koic)
    • 👕 #7934: Support autocorrection for Lint/EnsureReturn. (@koic)
    • #7922: Add new Layout/EmptyLineAroundAttributeAccessor cop. (@koic)

    🐛 Bug fixes

    • #7929: Fix Style/FrozenStringLiteralComment to accept frozen_string_literal anywhere in leading comment lines. (@jeffcarbs)
    • 💅 #7882: Fix Style/CaseEquality when AllowOnConstant is true and the method receiver is implicit. (@rafaelfranca)
    • #7790: Fix --parallel and --ignore-parent-exclusion combination. (@jonas054)
    • 0️⃣ #7881: Fix --parallel and --force-default-config combination. (@jonas054)
    • 💅 #7635: Fix a false positive for Style/MultilineWhenThen when then required for a body of when is used. (@koic)
    • #7905: Fix an error when running rubocop --only or rubocop --except options without cop name argument. (@koic)
    • 💅 #7903: Fix an incorrect autocorrect for Style/HashTransformKeys and Style/HashTransformValues cops when line break before to_h method. (@diogoosorio, @koic)
    • 🚦 #7899: Fix an infinite loop error for Layout/SpaceAroundOperators with Layout/ExtraSpacing when using ForceEqualSignAlignment: true. (@koic)
    • 💅 #7885: Fix Style/IfUnlessModifier logic when tabs are used for indentation. (@jonas054)
    • 👕 #7909: Fix a false positive for Lint/ParenthesesAsGroupedExpression when using an intended grouped parentheses. (@koic)
    • 👕 #7913: Fix a false positive for Lint/LiteralAsCondition when using true literal in while and similar cases. (@koic)
    • 💅 #7928: Fix a false message for Style/GuardClause when using and or or operators for guard clause in then or else branches. (@koic)
    • 💅 #7928: Fix a false positive for Style/GuardClause when assigning the result of a guard condition with else. (@koic)

    🔄 Changes

    • 0️⃣ #7860: Change AllowInHeredoc option of Layout/TrailingWhitespace to true by default. (@koic)
    • #7094: Clarify alignment in Layout/MultilineOperationIndentation. (@jonas054)
    • #4245: (Breaking) Inspect all files given on command line unless --only-recognized-file-types is given. (@jonas054)
    • #7390: (Breaking) Enabling a cop overrides disabling its department. (@jonas054)
    • 👕 #7936: Mark Lint/BooleanSymbol as unsafe. (@laurmurclar)
    • 💅 #7948: Mark unsafe for Style/OptionalArguments. (@koic)
    • #7931: Remove dependency on the jaro_winkler gem, instead depending on did_you_mean. This may be a breaking change for RuboCop libraries calling NameSimilarity#find_similar_name. (@bquorning)