Skip to content

Releases: rubocop/rubocop

RuboCop 1.33

04 Aug 09:28
Compare
Choose a tag to compare

Bug fixes

  • #10830: Fix an incorrect autocorrect for Layout/FirstArgumentIndentation when specifying EnforcedStyle: with_fixed_indentation of Layout/ArgumentAlignment and EnforcedStyle: consistent of Layout/FirstArgumentIndentation and enabling Layout/FirstMethodArgumentLineBreak. (@koic)
  • #10825: Fix an incorrect autocorrect for Style/ClassAndModuleChildren when using nested one-liner class. (@koic)
  • #10843: Fix a false positive for Style/HashExcept when using reject and calling include? method with symbol array and second block value. (@koic)
  • #10853: Fix an autocorrect for Style/RedundantSort with logical operator. (@ydah)
  • #10842: Make server mode aware of CacheRootDirectory config option value, RUBOCOP_CACHE_ROOT, and XDG_CACHE_HOME environment variables. (@koic)
  • #10833: Fix an incorrect autocorrect for Style/RedundantCondition when branches contains arithmetic operation. (@koic)
  • #10864: Fix a false positive for Style/SymbolProc when using Hash#reject. (@koic)
  • #10771: Make server mode aware of --cache-root command line option. (@koic)
  • #10831: Fix an error when using changed_parameters in obsoletion.yml by external library. (@koic)
  • #10850: Fix Style/ClassEqualityComparison autocorrection within module. (@r7kamura)
  • #10832: Fix an incorrect autocorrect for Layout/BlockEndNewline when multiline block } is not on its own line and using heredoc argument. (@koic)

Changes

  • #10841: Don't hash shared libraries for cache key. (@ChrisBr)
  • #10862: Add autocorrection to Lint/EmptyConditionalBody. (@dvandersluis)
  • #10829: Deprecate IgnoredMethods option in favor of the AllowedMethods and AllowedPatterns options. (@ydah)

RuboCop 1.32

21 Jul 10:35
Compare
Choose a tag to compare

New features

  • #10820: Add new Style/EmptyHeredoc cop. (@koic)
  • #10691: Add new Layout/MultilineMethodParameterLineBreaks cop. (@Korri)
  • #10790: Support AllowComments option for Style/EmptyElse. (@ydah)
  • #10792: Add new Lint/RequireRangeParentheses cop. (@koic)
  • #10692: Break long method definitions when auto-correcting. (@Korri)

Bug fixes

  • #10824: Make Lint/DeprecatedClassMethods aware of ENV.clone and ENV.dup. (@koic)
  • #10788: Relax Style/FetchEnvVar to allow ENV[] in LHS of ||. (@j-miyake)
  • #10813: Fix recursive deletion to suppression in Lint/NonAtomicFileOperation. (@ydah)
  • #10791: Fix an incorrect autocorrect for Style/Semicolon when using endless range before semicolon. (@koic)
  • #10781: Fix a suggestions for safer conversions for Lint/NonAtomicFileOperation. (@ydah)
  • #10263: Fix the value of Enabled leaking between configurations. (@jonas054)

Changes

  • #10613: Allow autocorrecting with -P/--parallel and make it the default. (@jonas054)
  • Add EnforcedStyle (leading/trailing) configuration to Layout::LineContinuationLeadingSpace. (@bquorning)
  • #10784: Preserve multiline semantics on Style/SymbolArray and Style/WordArray. (@r7kamura)
  • #10814: Avoid buffering stdout when running in server mode. (@ccutrer)
  • #10817: Add autocorrect support for Style/SafeNavigationChain. (@r7kamura)
  • #10810: Support safe navigation operator on Style/SymbolProc. (@r7kamura)
  • #10803: Require RuboCop AST 1.9.1 or higher. (@koic)

RuboCop 1.31.2

07 Jul 08:05
Compare
Choose a tag to compare

Bug fixes

  • #10774: Fix false negatives in Style/DocumentationMethod when a public method is defined after a private one. (@Darhazer)
  • #10764: Fix performance issue for Layout/FirstHashElementIndentation and Layout/FirstArrayElementIndentation. (@j-miyake)
  • #10780: Fix an error when using rubocop:auto_correct deprecated custom rake task. (@koic)
  • #10786: Fix a false positive for Lint/NonAtomicFileOperation when using complex conditional. (@koic)
  • #10785: Fix a false negative for Style/RedundantParentheses when parens around a receiver of a method call with an argument. (@koic)
  • #10026: Fix merging of array parameters in either parent of default config. (@jonas054)

RuboCop 1.31.1

29 Jun 06:56
Compare
Choose a tag to compare

Bug fixes

  • #10763: Fix a false positive for Layout/LineContinuationSpacing when using continuation keyword \ after __END__. (@koic)
  • #10755: Fix a false positive for Lint/LiteralAsCondition when using a literal in case-in condition where the match variable is used in in are accepted as a pattern matching. (@koic)
  • #10760: Fix a false positive for Lint/NonAtomicFileOperation when using FileTest.exist? with if condition that has else branch. (@koic)
  • #10745: Require JSON 2.3 or higher to fix an incompatible JSON API error. (@koic)
  • #10754: Fix an incorrect autocorrect for Style/HashExcept when using a non-literal collection receiver for include?. (@koic)
  • #10751: Fix autocorrect for Layout/FirstHashElementIndentation. (@j-miyake)
  • #10750: Recover 7x slow running rubocop. (@koic)

RuboCop 1.31

27 Jun 06:36
Compare
Choose a tag to compare

New features

  • #10699: Add new global ActiveSupportExtensionsEnabled option. (@nobuyo)
  • #10245: Add specification_version and rubygems_version to Gemspec/DeprecatedAttributeAssignment. (@kaitielth)
  • #10696: Add new Lint/NonAtomicFileOperation cop. (@ydah)
  • #6420: Add new Layout/LineContinuationLeadingSpace cop. (@bquorning)
  • #6420: Add new Layout/LineContinuationSpacing cop. (@bquorning)
  • #10706: Integrate rubocop-daemon to add server options. (@koic)
  • #10722: Add new Lint/ConstantOverwrittenInRescue cop. (@ydah)

Bug fixes

  • #10700: Update Style/EmptyMethod to not correct if the correction would exceed the configuration for Layout/LineLength. (@dvandersluis)
  • #10698: Enhance Style/HashExcept to support array inclusion checks. (@nobuyo)
  • #10734: Handle ClobberingError in Style/NestedTernaryOperator when there are multiple nested ternaries. (@dvandersluis)
  • #10689: Fix autocorrect for Layout/FirstHashElementIndentation and Layout/FirstArrayElementIndentation. (@j-miyake)
  • Fix rubocop -V not displaying the version information for rubocop-graphql, rubocop-md and rubocop-thread_safety. (@Darhazer)
  • #10711: Fix an error for Style/MultilineTernaryOperator when the false branch is on a separate line. (@koic)
  • #10719: Fix a false positive for Lint/ParenthesesAsGroupedExpression when using safe navigation operator. (@koic)
  • #10736: Fix Layout/SpaceInsideBlockBraces for blocks with numbered arguments. (@gsamokovarov)
  • #10749: Fix Style/BlockDelimiters for blocks with numbered arguments. (@gsamokovarov)
  • #10737: Fix crash in Style/ConditionalAssignment with EnforcedStyle: assign_inside_condition when op-assigning a variable inside a resbody. (@dvandersluis)
  • #7900: Fix Style/FormatStringToken false positive with formatted input and template style enforced, and add autocorrection. (@FnControlOption)

Changes

  • #10730: Change output timing of GitHubActionsFormatter. (@r7kamura)
  • #10709: Deprecate rubocop:auto_correct custom rake task and newly split rubocop:autocorrect and rubocop:autocorrect-all custom rake tasks. (@koic)
  • #9760: Change RangeHelp#range_with_surrounding_space to allow passing the range as a positional argument. (@pirj)
  • #10693: Add ignore case for Style/EmptyLinesAroundAttributeAccessor when there is a comment line on the next line. (@ydah)
  • #10245: (Breaking) integrate Gemspec/DateAssignment into Gemspec/DeprecatedAttributeAssignment. (@kaitielth)
  • #10697: Restore Lint/UselessElseWithoutRescue cop. (@koic)
  • #10740: Make Style/GuardClause a bit more lenient when the replacement would make the code more verbose. (@dvandersluis)

RuboCop 1.30.1

06 Jun 08:19
Compare
Choose a tag to compare

Bug fixes

  • #10685: Fix a false positive for Style/StringConcatenation when Mode: conservative and first operand is not string literal. (@koic)
  • #10670: Fix a false positive for Style/FetchEnvVar in the body with assignment method. (@ydah)
  • #10671: Fix an incorrect autocorrect for EnforcedStyle: with_first_argument of Layout/ArgumentAlignment and EnforcedColonStyle: separator of Layout/HashAlignment. (@koic)
  • #10676: Fix --ignore-unrecognized-cops option always showing empty warning even if there was no problem. (@nobuyo)
  • #10674: Fix a false positive for Naming/AccessorMethodName with type of the first argument is other than arg. (@ydah)
  • #10679: Fix a false positive for Style/SafeNavigation when TargetRubyVersion: 2.2 or lower. (@koic)

Changes

  • #10673: Update auto-gen-config's comment re auto-correct for SafeAutoCorrect: false. (@ydah)

RuboCop 1.30

26 May 06:06
Compare
Choose a tag to compare

New features

  • #10065: Add new Gemspec/DeprecatedAttributeAssignment cop. (@koic)
  • #10608: Add new Style/MapCompactWithConditionalBlock cop. (@nobuyo)
  • #10627: Add command-line option --ignore-unrecognized-cops to ignore any unknown cops or departments in .rubocop.yml. (@nobuyo)
  • #10620: Add Sorbet's typed sigil as a magic comment. (@zachahn)

Bug fixes

  • #10662: Recover Ruby 2.1 code analysis using TargetRubyVersion: 2.1. (@koic)
  • #10396: Fix autocorrect for Layout/IndentationWidth to leave module/class body unchanged to avoid infinite autocorrect loop with Layout/IndentationConsistency when body trails after class/module definition. (@johnny-miyake)
  • #10636: Fix false positive in Style/RedundantCondition when the branches call the same method on different receivers. (@dvandersluis)
  • #10651: Fix autocorrect for Style/For when using array with operator methods as collection. (@nobuyo)
  • #10629: Fix default Ruby version from 2.5 to 2.6. (@koic)
  • #10661: Fix a false negative for Style/SymbolProc when method has no arguments and AllowMethodsWithArguments: true. (@koic)
  • #10631: Fix autocorrect for Style/RedundantBegin. (@johnny-miyake)
  • #10652: Fix a false positive for Style/FetchEnvVar in conditions. (@ydah)
  • #10665: Fix an incorrect autocorrect for EnforcedStyle: with_first_argument of Layout/ArgumentAlignment and EnforcedColonStyle: separator of Layout/HashAlignment. (@koic)
  • #10258: Recover Ruby 2.4 code analysis using TargetRubyVersion: 2.4. (@koic)
  • #10668: Recover Ruby 2.0 code analysis using TargetRubyVersion: 2.0. (@koic)
  • #10644: Recover Ruby 2.2 code analysis using TargetRubyVersion: 2.2. (@koic)
  • #10639: Fix Style/HashSyntax to exclude files that violate it with EnforceHashShorthandSyntax when running auto-gen-config. (@nobuyo)
  • #10633: Fix infinite autocorrection loop in Style/AccessorGrouping when combining multiple of the same accessor. (@dvandersluis)
  • #10618: Fix LineBreakCorrector so that it won't remove a semicolon in the class/module body. (@johnny-miyake)
  • #10646: Fix an incorrect autocorrect for Style/SoleNestedConditional when using unless and && without parens in the outer condition and nested modifier condition. (@koic)
  • #10659: Fix automatically appended path for inherit_from by auto-gen-config is incorrect if specified config file in a subdirectory as an option. (@nobuyo)
  • #10640: Recover Ruby 2.3 code analysis using TargetRubyVersion: 2.3. (@koic)
  • #10657: Fix --auto-gen-config command option ignores specified config file by option. (@nobuyo)

Changes

  • #10095: Change "auto-correct" to "autocorrect" in arguments, documentation, messages, comments, and specs. (@chris-hewitt)
  • #10656: Mark Style/RedundantInterpolation as unsafe autocorrection. (@koic)
  • #10616: Markdown formatter: skip files with no offenses. (@rickselby)

RuboCop 1.29.1

12 May 11:23
Compare
Choose a tag to compare

Bug fixes

  • #10625: Restore the specification to TargetRubyVersion: 2.5. (@koic)
  • #10569: Fix a false positive for Style/FetchEnvVar when using the same ENV var as if condition in the body. (@koic)
  • #10614: Make Lint/NonDeterministicRequireOrder aware of require_relative. (@koic)
  • #10607: Fix autocorrect for Style/RedundantCondition when there are parenthesized method calls in each branch. (@nobuyo)
  • #10622: Fix a false positive for Style/RaiseArgs when error type class constructor with keyword arguments and message argument. (@koic)
  • #10610: Fix an error for Naming/InclusiveLanguage string with invalid byte sequence in UTF-8. (@ydah)
  • #10605: Fix autocorrect for Style/RedundantCondition if argument for method in else branch is hash without braces. (@nobuyo)

RuboCop 1.29

06 May 15:53
Compare
Choose a tag to compare

New features

Bug fixes

  • #10586: Fix a false positive for Style/DoubleNegation when using define_method or define_singleton_method. (@ydah)
  • #10579: Fix a false positive for Style/FetchEnvVar when calling a method with safe navigation. (@koic)
  • #10581: Fix a false positive for Style/FetchEnvVar when comparing with ENV['TERM']. (@koic)
  • #10589: Fix autocorrect for Style/RaiseArgs with EnforcedStyle: compact and exception object is assigned to a local variable. (@nobuyo)
  • #10325: Enhance Style/RedundantCondition by considering the case that variable assignments in each branch. (@nobuyo)
  • #10592: Fix infinite loop on Style/MultilineTernaryOperator if using assignment method and condition/branch is multiline. (@nobuyo)
  • #10536: Fix validation for command-line options combination of --display-only-fail-level-offenses and --auto-correct. (@nobuyo)

Changes

  • #10577: (Compatibility) Drop support for Ruby 2.5 and JRuby 9.2 (CRuby 2.5 compatible). (@koic)
  • #10585: Enhance the autocorrect for Style/FetchEnvVar. (@johnny-miyake)
  • #10577: (Breaking) Retire Lint/UselessElseWithoutRescue cop. (@koic)

RuboCop 1.28.2

25 Apr 08:07
Compare
Choose a tag to compare

Bug fixes

  • #10566: Fix a false positive for Lint/AmbiguousBlockAssociation when using proc is used as a last argument. (@koic)
  • #10573: Fix a false positive for Layout/SpaceBeforeBrackets when there is a dot before brackets. (@nobuyo)
  • #10563: Fix Style/BlockDelimiters unexpectedly deletes block on moving comment if methods with block are chained. (@nobuyo)
  • #10574: Fix a false positive for Style/SingleArgumentDig when using dig with arguments forwarding. (@ydah)
  • #10565: Fix a false positive and a true negative for Style/FetchEnvVar. (@koic)