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 andRUBOCOP_OPTS
environment variable. (@bolshakov) - #2857:
Style/MultilineArrayBraceLayout
enforced style is configurable and supportssymmetrical
andnew_line
options. (@panthomakos) - #2857:
Style/MultilineHashBraceLayout
enforced style is configurable and supportssymmetrical
andnew_line
options. (@panthomakos) - #2857:
Style/MultilineMethodCallBraceLayout
enforced style is configurable and supportssymmetrical
andnew_line
options. (@panthomakos) - #2857:
Style/MultilineMethodDefinitionBraceLayout
enforced style is configurable and supportssymmetrical
andnew_line
options. (@panthomakos) - #3052:
Style/MultilineArrayBraceLayout
enforced style supportssame_line
option. (@panthomakos) - #3052:
Style/MultilineHashBraceLayout
enforced style supportssame_line
option. (@panthomakos) - #3052:
Style/MultilineMethodCallBraceLayout
enforced style supportssame_line
option. (@panthomakos) - #3052:
Style/MultilineMethodDefinitionBraceLayout
enforced style supportssame_line
option. (@panthomakos) - #3019: Add new
Style/EmptyCaseCondition
cop. (@owst, @rrosenblum) - #3072: Add new
Lint/UselessArraySplat
cop. (@owst) - #3022:
Style/Lambda
enforced style supportsliteral
option. (@drenmi) - #2909:
Style/Lambda
enforced style supportslambda
option. (@drenmi) - #3092: Allow
Style/Encoding
to enforce using no encoding comments. (@NobodysNightmare) - New cop
Rails/UniqBeforePluck
checks thatuniq
is used beforepluck
. (@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 forwith_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 notStyle/SpaceAfterColon
too). (@owst) - #3006: Register an offense for calling
merge!
on a method on a variable insideeach_with_object
inPerformance/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 inPerformance/EndWith
. (@lumeet) - #3039: Accept
match
without a receiver inPerformance/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 ofalias
ininstance_eval
blocks, since object instances don't respond toalias_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 + \
intoa + \\
inStyle/LineEndConcatenation
. (@jonas054) - #3034: Report offenses for
RuntimeError.new(msg)
inStyle/RedundantException
. (@jonas054) - #3016:
Style/SpaceAfterComma
now usesStyle/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 ofIgnoredMethods
ofStyle/SymbolProc
. (@jastkand) - #3064:
Style/SpaceAfterNot
highlights the entire expression instead of just the exlamation mark. (@rrosenblum) - #3085: Enable
Style/MultilineArrayBraceLayout
andStyle/MultilineHashBraceLayout
with thesymmetrical
style by default. (@panthomakos) - #3091: Enable
Style/MultilineMethodCallBraceLayout
andStyle/MultilineMethodDefinitionBraceLayout
with thesymmetrical
style by default. (@panthomakos) - #1830:
Style/PredicateName
now ignores thespec/
directory, since there is a strong convention for usinghave_*
andbe_*
helper methods in RSpec. (@gylaz)