relnotes/v0.19.0.md
This is the biggest RuboCop release we've done in a while. The highlights include about a dozen new cops, more cop configuration options, improved auto-correct and so many bugfixes.
You'll might note that we changed the use of offence with offense. This was done to keep the spelling
in our code consistent. Hopefully this won't cause anyone problems, but we're obliged to mention it as
the Offence class itself got renamed.
Below is the list of all the gory details. Enjoy!
FileName makes sure that source files have snake_case names. (@bbatsov)DeprecatedClassMethods checks for deprecated class methods. (@bbatsov)StringConversionInInterpolation checks for redundant Object#to_s in string interpolation. (@bbatsov)LiteralInInterpolation checks for interpolated string literals. (@bbatsov)SelfAssignment checks for places where the self-assignment shorthand should have been used. (@bbatsov)DoubleNegation checks for uses of !!. (@bbatsov)PercentLiteralDelimiters enforces consistent usage of %-literal delimiters. (@hannestyden)ActionFilter enforces the use of _filter or _action action filter methods. (@bbatsov)ScopeArgs makes sure you invoke the scope method properly. (@bbatsov)with_fixed_indentation style to AlignParameters cop. (@hannestyden)IgnoreLastArgumentHash option to AlignHash cop. (@hannestyden)SingleLineMethods cop does auto-correction. (@jonas054)Semicolon cop does auto-correction. (@jonas054)EmptyLineBetweenDefs cop does auto-correction. (@jonas054)IndentationWidth cop does auto-correction. (@jonas054)IndentationConsistency cop does auto-correction. (@jonas054)fuubar displays a progress bar and shows details of offenses as soon as they are detected. (@yujinakayama)IndentHash checks the indentation of the first key in multi-line hash literals. (@jonas054)IndentArray checks the indentation of the first element in multi-line array literals. (@jonas054)vendor/** by default. (@jeremyolliver)IfUnlessModifier and WhileUntilModifier supports MaxLineLength, which is independent of LineLength parameter Max. (@agrimm)ClassAndModuleChildren checks the style of children definitions at classes and modules: nested / compact. (@geniou)rubocop --format offences. (@ma2gedev)Ignore param from the Rails Output cop. The standard Exclude/Include should be used instead. (@bbatsov)FavorSprintf to FormatString and made it configurable. (@bbatsov)Offence to Offense. (@bbatsov)offense in all messages instead of offence. (@bbatsov)if/unless/while/until bodies when the result is assigned to a variable, instead of supporting two styles simultaneously, IndentationWidth now supports one style of indentation at a time, specified by EndAlignment/AlignWith. (@jonas054)Style param of DotPosition cop to EnforcedStyle. (@bbatsov)length value to locations of offense in JSON formatter. (@yujinakayama)SpaceAroundBlockBraces cop replaced by SpaceBeforeBlockBraces and SpaceInsideBlockBraces. (@jonas054)SpaceAroundEqualsInParameterDefault cop is now configurable with the EnforcedStyle option. (@jonas054)MethodDefParentheses and other cops. (@jonas054)ParenthesesAroundCondition. (@bbatsov)begin..rescue..end with retry) in UselessAssignment. (@yujinakayama)EmptyLines. (@bbatsov)RangeError or "clobbering". (@jonas054)--auto-correct runs. (@jonas054)[Corrected] tag sometimes missing in output from --auto-correct runs. (@jonas054)EndAlignment cop when AlignWith is keyword. (@jonas054)case conditions in LiteralInCondition. (@bbatsov)DotPosition when enforced style is set to trailing. (@bbatsov)LineEndConcatenation. (@bbatsov)BracesAroundHashParameters and SpaceInsideHashLiteralBraces. (@jonas054)IndentationWidth auto-correction so it doesn't correct things that IndentationConsistency should correct. (@jonas054)RegexpLiteral concerning --auto-gen-config. (@jonas054)--show-cops that made it print the default configuration rather than the current configuration. (@jonas054)rubocop:disable comments with indentations were treated as multiline cop disabling comments. (@yujinakayama)rubocop:disable comments with a cop name including all (e.g. MethodCallParentheses) were disabling all cops. (@yujinakayama)# rubocop:disable were confused with real comments. (@yujinakayama)