Rubocop v0.90.0 Release Notes

Release Date: 2020-09-01 // over 3 years ago
  • ๐Ÿ†• New features

    • ๐Ÿ’… #8451: Add new Style/RedundantSelfAssignment cop. (@fatkodima)
    • #8384: Add new Layout/EmptyLineAfterMultilineCondition cop. (@fatkodima)
    • ๐Ÿ’… #8390: Add new Style/SoleNestedConditional cop. (@fatkodima)
    • ๐Ÿ’… #8562: Add new Style/KeywordParametersOrder cop. (@fatkodima)
    • ๐Ÿ’… #8486: Add new Style/CombinableLoops cop. (@fatkodima)
    • ๐Ÿ’… #8381: Add new Style/ClassMethodsDefinitions cop. (@fatkodima)
    • ๐Ÿ‘• #8474: Add new Lint/DuplicateRequire cop. (@fatkodima)
    • ๐Ÿ‘• #8472: Add new Lint/UselessMethodDefinition cop. (@fatkodima)
    • ๐Ÿ‘• #8531: Add new Lint/EmptyFile cop. (@fatkodima)
    • โž• Add new Lint/TrailingCommaInAttributeDeclaration cop. (@drenmi)
    • #8578: Add :restore_registry context and stub_cop_class helper class. (@marcandre)
    • ๐Ÿ“š #8579: Add Cop.documentation_url. (@marcandre)
    • ๐Ÿ“œ #8510: Add RegexpNode#each_capture and parsed_tree. (@marcandre)
    • โšก๏ธ #8365: Cops defining on_send can be optimized by defining the constant RESTRICT_ON_SEND with a list of acceptable method names. (@marcandre)

    ๐Ÿ› Bug fixes

    • ๐Ÿ’… #8508: Fix a false positive for Style/CaseLikeIf when conditional contains comparison with a class. Mark Style/CaseLikeIf as not safe. (@fatkodima)
    • #8618: Fix an infinite loop error for Layout/EmptyLineBetweenDefs. (@fatkodima)
    • ๐Ÿ‘• #8534: Fix Lint/BinaryOperatorWithIdenticalOperands for binary operators used as unary operators. (@marcandre)
    • #8537: Allow a trailing comment as a description comment for Bundler/GemComment. (@pocke)
    • ๐Ÿ’… #8507: Fix Style/RescueModifier to handle parentheses around rescue modifiers. (@dsavochkin)
    • ๐Ÿ’… #8527: Prevent an incorrect auto-correction for Style/CaseEquality cop when comparing with === against a regular expression receiver. (@koic)
    • #8524: Fix Layout/EmptyLinesAroundClassBody and Layout/EmptyLinesAroundModuleBody to correctly handle an access modifier as a first child. (@dsavochkin)
    • ๐Ÿ‘• #8518: Fix Lint/ConstantResolution cop reporting offense for module and class definitions. (@tejasbubane)
    • ๐Ÿ’… #8158: Fix Style/MultilineWhenThen cop to correctly handle cases with multiline body. (@dsavochkin)
    • ๐Ÿ’… #7705: Fix Style/OneLineConditional cop to handle if/then/elsif/then/else/end cases. Add AlwaysCorrectToMultiline config option to this cop to always convert offenses to the multi-line form (false by default). (@Lykos, @dsavochkin)
    • #8590: Fix an error when auto-correcting encoding mismatch file. (@koic)
    • ๐Ÿ’… #8321: Enable auto-correction for Layout/{Def}EndAlignment, Lint/EmptyEnsure, Style/ClassAndModuleChildren. (@marcandre)
    • ๐Ÿ’… #8583: Fix Style/RedundantRegexpEscape false positive for line continuations. (@owst)
    • ๐Ÿ’… #8593: Fix Style/RedundantRegexpCharacterClass false positive for interpolated multi-line expressions. (@owst)
    • ๐Ÿ’… #8624: Fix an error with the Style/CaseLikeIf cop where it does not properly handle overridden equality methods with no arguments. (@Skipants)

    ๐Ÿ”„ Changes

    • โš  #8413: Pending cops warning now contains snippet that can be directly copied into .rubocop.yml as well as a notice about NewCops: enable config option. (@colszowka)
    • #8362: Add numbers of correctable offenses to summary. (@nguyenquangminh0711)
    • ๐Ÿ“š #8513: Clarify the ruby warning mentioned in the Lint/ShadowingOuterLocalVariable documentation. (@chocolateboy)
    • ๐Ÿ’… #8517: Make Style/HashTransformKeys and Style/HashTransformValues aware of to_h with block. (@eugeneius)
    • ๐Ÿ‘• #8529: Mark Lint/FrozenStringLiteralComment as Safe, but with unsafe auto-correction. (@marcandre)
    • ๐Ÿ’Ž #8602: Fix usage of to_enum(:scan, regexp) to work on TruffleRuby. (@jaimerave)