github rubocop/rubocop v0.40.0
RuboCop 0.40

latest releases: v1.63.5, v1.63.3, v1.63.4...
8 years ago

New features

  • #2997: Performance/CaseWhenSplat can now identify multiple offenses in the same branch and offenses that do not occur as the first argument. (@rrosenblum)
  • #2928: Style/NestedParenthesizedCalls cop can auto-correct. (@drenmi)
  • Style/RaiseArgs cop can auto-correct. (@drenmi)
  • #2993: Style/SpaceAfterColon now checks optional keyword arguments. (@owst)
  • #3003: Read command line options from .rubocop file and RUBOCOP_OPTS environment variable. (@bolshakov)
  • #2857: Style/MultilineArrayBraceLayout enforced style is configurable and supports symmetrical and new_line options. (@panthomakos)
  • #2857: Style/MultilineHashBraceLayout enforced style is configurable and supports symmetrical and new_line options. (@panthomakos)
  • #2857: Style/MultilineMethodCallBraceLayout enforced style is configurable and supports symmetrical and new_line options. (@panthomakos)
  • #2857: Style/MultilineMethodDefinitionBraceLayout enforced style is configurable and supports symmetrical and new_line options. (@panthomakos)
  • #3052: Style/MultilineArrayBraceLayout enforced style supports same_line option. (@panthomakos)
  • #3052: Style/MultilineHashBraceLayout enforced style supports same_line option. (@panthomakos)
  • #3052: Style/MultilineMethodCallBraceLayout enforced style supports same_line option. (@panthomakos)
  • #3052: Style/MultilineMethodDefinitionBraceLayout enforced style supports same_line option. (@panthomakos)
  • #3019: Add new Style/EmptyCaseCondition cop. (@owst, @rrosenblum)
  • #3072: Add new Lint/UselessArraySplat cop. (@owst)
  • #3022: Style/Lambda enforced style supports literal option. (@drenmi)
  • #2909: Style/Lambda enforced style supports lambda option. (@drenmi)
  • #3092: Allow Style/Encoding to enforce using no encoding comments. (@NobodysNightmare)
  • New cop Rails/UniqBeforePluck checks that uniq is used before pluck. (@tjwp)

Bug fixes

  • #3112: Fix Style/ClassAndModuleChildren for nested classes with explicit superclass. (@jspanjers)
  • #3032: Fix autocorrecting parentheses for predicate methods without space before args. (@graemeboy)
  • #3000: Fix encoding crash on HTML output. (@gerrywastaken)
  • #2983: Style/AlignParameters message was clarified for with_fixed_indentation style. (@dylanahsmith)
  • #2314: Ignore UnusedBlockArgument for keyword arguments. (@volkert)
  • #2975: Make comment indentation before ) consistent with comment indentation before } or ]. (@jonas054)
  • #3010: Fix double reporting/correction of spaces after ternary operator colons (now only reported by Style/SpaceAroundOperators, and not Style/SpaceAfterColon too). (@owst)
  • #3006: Register an offense for calling merge! on a method on a variable inside each_with_object in Performance/RedundantMerge. (@lumeet, @rrosenblum)
  • #2886: Custom cop changes now bust the cache. (@ptarjan)
  • #3043: Style/SpaceAfterNot will now register an offense for a receiver that is wrapped in parentheses. (@rrosenblum)
  • #3039: Accept match without a receiver in Performance/EndWith. (@lumeet)
  • #3039: Accept match without a receiver in Performance/StartWith. (@lumeet)
  • #3048: Lint/NestedMethodDefinition shouldn't flag methods defined on Structs. (@owst)
  • #2912: Check whether a line is aligned with the following line if the preceding line is not an assignment. (@akihiro17)
  • #3036: Don't let Lint/UnneededDisable inspect files that are excluded for the cop. (@jonas054)
  • #2874: Fix bug when the closing parenthesis is preceded by a newline in array and hash literals in Style/RedundantParentheses. (@lumeet)
  • #3049: Make Lint/UselessAccessModifier detect conditionally defined methods and correctly handle dynamically defined methods and singleton class methods. (@owst)
  • #3004: Don't add Style/Alias offenses for use of alias in instance_eval blocks, since object instances don't respond to alias_method. (@magni-)
  • #3061: Custom cops now show up in --show-cops. (@ptarjan)
  • #3088: Ignore offenses that involve conflicting HEREDOCs in the Style/Multiline*BraceLayout cops. (@panthomakos)
  • #3083: Do not register an offense for splat block args in Style/SymbolProc. (@rrosenblum)
  • #3063: Don't auto-correct a + \ into a + \\ in Style/LineEndConcatenation. (@jonas054)
  • #3034: Report offenses for RuntimeError.new(msg) in Style/RedundantException. (@jonas054)
  • #3016: Style/SpaceAfterComma now uses Style/SpaceInsideHashLiteralBraces's setting. (@ptarjan)

Changes

  • #2995: Removed deprecated path matching syntax. (@gerrywastaken)
  • #3025: Removed deprecation warnings for rubocop-todo.yml. (@ptarjan)
  • #3028: Add define_method to the default list of IgnoredMethods of Style/SymbolProc. (@jastkand)
  • #3064: Style/SpaceAfterNot highlights the entire expression instead of just the exlamation mark. (@rrosenblum)
  • #3085: Enable Style/MultilineArrayBraceLayout and Style/MultilineHashBraceLayout with the symmetrical style by default. (@panthomakos)
  • #3091: Enable Style/MultilineMethodCallBraceLayout and Style/MultilineMethodDefinitionBraceLayout with the symmetrical style by default. (@panthomakos)
  • #1830: Style/PredicateName now ignores the spec/ directory, since there is a strong convention for using have_* and be_* helper methods in RSpec. (@gylaz)

Don't miss a new rubocop release

NewReleases is sending notifications on new releases.