Rubocop v0.91.0 Release Notes

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

    • New option --cache-root and support for the RUBOCOP_CACHE_ROOT environment variable. Both can be used to override the AllCops: CacheRootDirectory config, especially in a CI setting. (@sascha-wolf)
    • #8582: Add new Layout/BeginEndAlignment cop. (@koic)
    • ๐Ÿ‘• #8699: Add new Lint/IdentityComparison cop. (@koic)
    • โž• Add new Lint/UselessTimes cop. (@dvandersluis)
    • ๐Ÿ‘• #8707: Add new Lint/ConstantDefinitionInBlock cop. (@eugeneius)

    ๐Ÿ› Bug fixes

    • ๐Ÿ‘• #8627: Fix a false positive for Lint/DuplicateRequire when same feature argument but different require method. (@koic)
    • #8674: Fix an error for Layout/EmptyLineAfterMultilineCondition when conditional is at the top level. (@fatkodima)
    • ๐Ÿ’… #8658: Fix a false positive for Style/RedundantSelfAssignment when calling coercion methods. (@fatkodima)
    • ๐Ÿ‘• #8669: Fix an offense creation for Lint/EmptyFile. (@fatkodima)
    • ๐Ÿ‘• #8607: Fix a false positive for Lint/UnreachableLoop when conditional branch includes continue statement preceding break statement. (@fatkodima)
    • ๐Ÿ’… #8572: Fix a false positive for Style/RedundantParentheses when parentheses are used like method argument parentheses. (@koic)
    • ๐Ÿ’… #8630: Fix some false positives for Style/HashTransformKeys and Style/HashTransformValues when the receiver is an array. (@eugeneius)
    • #8653: Fix a false positive for Layout/DefEndAlignment when using refinements and private def. (@koic)
    • ๐Ÿ’… #8655: Fix a false positive for Style/ClassAndModuleChildren when using cbase class name. (@koic)
    • ๐Ÿ’… #8654: Fix a false positive for Style/SafeNavigation when checking foo&.empty? in a conditional. (@koic)
    • ๐Ÿ’… #8660: Fix a false positive for Style/ClassAndModuleChildren when using cbase module name. (@koic)
    • #8664: Fix a false positive for Naming/BinaryOperatorParameterName when naming multibyte character method name. (@koic)
    • #8604: Fix a false positive for Bundler/DuplicatedGem when gem is duplciated in condition. (@tejasbubane)
    • ๐Ÿ’… #8671: Fix an error for Style/ExplicitBlockArgument when using safe navigation method call. (@koic)
    • ๐Ÿ’… #8681: Fix an error for Style/HashAsLastArrayItem with no_braces for empty hash. (@fsateler)
    • #8682: Fix a positive for Style/HashTransformKeys and Style/HashTransformValues when the each_with_object hash is used in the transformed key or value. (@eugeneius)
    • ๐Ÿ’… #8688: Mark Style/GlobalStdStream as unsafe autocorrection. (@marcandre)
    • ๐Ÿ’… #8642: Fix a false negative for Style/SpaceInsideHashLiteralBraces when a correct empty hash precedes the incorrect hash. (@dvandersluis)
    • #8683: Make naming cops work with non-ascii characters. (@tejasbubane)
    • ๐Ÿ‘• #8626: Fix false negatives for Lint/UselessMethodDefinition. (@marcandre)
    • ๐Ÿ‘ป #8698: Fix cache to avoid encoding exception. (@marcandre)
    • ๐Ÿ‘• #8704: Fix an error for Lint/AmbiguousOperator when using safe navigation operator with a unary operator. (@koic)
    • ๐Ÿ’… #8661: Fix an incorrect auto-correct for Style/MultilineTernaryOperator when returning a multiline ternary operator expression. (@koic)
    • ๐Ÿ’… #8526: Fix a false positive for Style/CaseEquality cop when the receiver is not a camel cased constant. (@koic)
    • ๐Ÿ“œ #8673: Fix the JSON parse error when specifying --format=json and --stdin options. (@koic)

    ๐Ÿ”„ Changes

    • ๐Ÿ’… #8470: Do not autocorrect Style/StringConcatenation when parts of the expression are too complex. (@dvandersluis)
    • ๐Ÿ‘• #8561: Fix Lint/UselessMethodDefinition to not register an offense when method definition includes optional arguments. (@fatkodima)
    • ๐Ÿ’… #8617: Fix Style/HashAsLastArrayItem to not register an offense when all items in an array are hashes. (@dvandersluis)
    • ๐Ÿ‘• #8500: Add in? to AllowedMethods for Lint/SafeNavigationChain cop. (@tejasbubane)
    • ๐Ÿ— #8629: Fix the cache being reusable in CI by using crc32 to calculate file hashes rather than mtime, which changes each CI build. (@dvandersluis)
    • ๐Ÿ’… #8663: Fix multiple autocorrection bugs with Style/ClassMethodsDefinitions. (@dvandersluis)
    • #8621: Add helpful Infinite Loop error message. (@iSarCasm)