github rubocop/rubocop v0.44.0
RuboCop 0.44 (The Birthday Release)

latest releases: v1.63.3, v1.63.4, v1.63.2...
7 years ago

New features

  • #3560: Add a configuration option empty_lines_except_namespace to Style/EmptyLinesAroundClassBody and Style/EmptyLinesAroundModuleBody. (@legendetm)
  • #3370: Add new Rails/HttpPositionalArguments cop to check your Rails 5 test code for existence of positional args usage. (@logicminds)
  • #3510: Add a configuration option, ConvertCodeThatCanStartToReturnNil, to Style/SafeNavigation to check for code that could start returning nil if safe navigation is used. (@rrosenblum)
  • Add a new AllCops/StyleGuideBaseURL setting that allows the use of relative paths and/or fragments within each cop's StyleGuide setting, to make forking of custom style guides easier. (@scottmatthewman)
  • #3566: Add new Metric/BlockLength cop to ensure blocks don't get too long. (@savef)
  • #3428: Add support for configuring Style/PreferredHashMethods with either short or verbose style method names. (@abrom)
  • #3455: Add new Rails/DynamicFindBy cop. (@pocke)
  • #3542: Add a configuration option, IgnoreCopDirectives, to Metrics/LineLength to stop cop directives (# rubocop:disable Metrics/AbcSize) from being counted when considering line length. (@jmks)
  • Add new Rails/DelegateAllowBlank cop. (@connorjacobsen)
  • Add new Style/MultilineMemoization cop. (@drenmi)

Bug fixes

  • #3103: Make Style/ExtraSpacing cop register an offense for extra spaces present in single-line hash literals. (@tcdowney)
  • #3513: Fix false positive in Style/TernaryParentheses for a ternary with ranges. (@dreyks)
  • #3520: Fix regression causing Lint/AssignmentInCondition false positive. (@savef)
  • #3514: Make Style/VariableNumber cop not register an offense when valid normal case variable names have an integer after the first _. (@b-t-g)
  • #3516: Make Style/VariableNumber cop not register an offense when valid normal case variable names have an integer in the middle. (@b-t-g)
  • #3436: Make Rails/SaveBang cop not register an offense when return value of a non-bang method is returned by the parent method. (@coorasse)
  • #3540: Fix Style/GuardClause to register offense for instance and singleton methods. (@tejasbubane)
  • #3311: Detect incompatibilities with the external encoding to prevent bad autocorrections in Style/StringLiterals. (@deivid-rodriguez)
  • #3499: Ensure Lint/UnusedBlockArgument doesn't make recommendations that would change arity for methods defined using #define_method. (@drenmi)
  • #3430: Fix exception in Performance/RedundantMerge when inspecting a #merge! with implicit receiver. (@drenmi)
  • #3411: Avoid auto-correction crash for single when in Performance/CaseWhenSplat. (@jonas054)
  • #3286: Allow self.a, self.b = b, a in Style/ParallelAssignment. (@jonas054)
  • #3419: Report offense for unless x.nil? in Style/NonNilCheck if IncludeSemanticChanges is true. (@jonas054)
  • #3382: Avoid auto-correction crash for multiple elsifs in Style/EmptyElse. (@lumeet)
  • #3334: Do not register an offense for a literal space (\s) in Style/UnneededCapitalW. (@rrosenblum)
  • #3390: Fix SaveBang cop for multiple conditional. (@tejasbubane)
  • #3577: Fix Style/RaiseArgs not allowing compact raise with splatted args. (@savef)
  • #3578: Fix safe navigation method call counting in Metrics/AbcSize. (@savef)
  • #3592: Fix Style/RedundantParentheses for indexing with literals. (@thegedge)
  • #3597: Fix the autocorrect of Performance/CaseWhenSplat when trying to rearange splat expanded variables to the end of a when condition. (@rrosenblum)

Changes

  • #3512: Change error message of Lint/UnneededSplatExpansion for array in method parameters. (@tejasbubane)
  • #3510: Fix some issues with Style/SafeNavigation. Fix auto-correct of multiline if expressions, and do not register an offense for scenarios using || and ternary expression. (@rrosenblum)
  • #3503: Change misleading message of Style/EmptyLinesAroundAccessModifier. (@bquorning)
  • #3407: Turn off autocorrect for unsafe rules by default. (@ptarjan)
  • #3521: Turn off autocorrect for Security/JSONLoad by default. (@savef)
  • #2903: Style/RedundantReturn looks for redundant return inside conditional branches. (@lumeet)

Don't miss a new rubocop release

NewReleases is sending notifications on new releases.