New features
- #2081: New cop
Style/Send
checks for the use ofsend
and instead encourages changing it toBasicObject#__send__
orObject#public_send
(disabled by default). (@syndbg) - #2057: New cop
Lint/FormatParameterMismatch
checks for a mismatch between the number of fields expected in format/sprintf/% and what was pased to it. (@edmz) - #2010: Add
space
style for SpaceInsideStringInterpolation. (@gotrevor) - #2007: Allow any modifier before
def
, not only visibility modifiers. (@fphilipe) - #1980:
--auto-gen-config
now outputs an excluded files list for failed cops (up to a maxiumum of 15 files). (@bmorrall) - #2004: Introduced
--exclude-limit COUNT
to configure how many files--auto-gen-config
will exclude. (@awwaiid, @jonas054) - #1918: New configuration parameter
AllCops:DisabledByDefault
when set totrue
makes only cops found in user configuration enabled, which makes cop selection opt-in. (@jonas054) - New cop
Performance/StringReplacement
checks for usages ofgsub
that can be replaced withtr
ordelete
. (@rrosenblum) - #2001: New cop
Style/InitialIndentation
checks for indentation of the first non-blank non-comment line in a file. (@jonas054) - #2060: New cop
Style/RescueEnsureAlignment
checks for bad alignment ofrescue
andensure
keywords. (@lumeet) - New cop
Style/OptionalArguments
checks for optional arguments that do not appear at the end of an argument list. (@rrosenblum) - New cop
Lint/CircularArgumentReference
checks for "circular argument references" in keyword arguments, which Ruby 2.2 warns against. (@maxjacobson, @sliuu) - #2030: New cop
Lint/OptionHash
checks for option hashes and encourages changing them to keyword arguments (disabled by default). (@maxjacobson)
Changes
- #2052:
Style/RescueModifier
uses token stream to identify offenses. (@urbanautomaton) - Rename
Rails/Date
andRails/TimeZone
style names to "strict" and "flexible" and make "flexible" to be default. (@palkan) - #2035:
Style/ExtraSpacing
is now enabled by default and has a configuration parameterAllowForAlignment
that istrue
by default, making it allow extra spacing if it's used for alignment purposes. (@jonas054)
Bugs fixed
- #2014: Fix
Style/TrivialAccessors
to support AllowPredicates: false. (@gotrevor) - #1988: Fix bug in
Style/ParallelAssignment
when assigning fromModule::CONSTANT
. (@rrosenblum) - #1995: Improve message for
Rails/TimeZone
. (@palkan) - #1977: Fix bugs in
Rails/Date
andRails/TimeZone
when using namespaced Time/Date. (@palkan) - #1973: Do not register an offense in
Performance/Detect
whenselect
is called onEnumerable::Lazy
. (@palkan) - #2015: Fix bug occurring for auto-correction of a misaligned
end
in a file with only one method. (@jonas054) - Allow string interpolation segments inside single quoted string literals when double quotes are preferred. (@segiddins)
- #2026: Allow
Time.current
when style is "acceptable".(@palkan) - #2029: Fix bug where
Style/RedundantReturn
auto-corrects returning implicit hashes to invalid syntax. (@rrosenblum) - #2021: Fix bug in
Style/BlockDelimiters
when asemantic
expression is used in an array or a range. (@lumeet) - #1992: Allow parentheses in assignment to a variable with the same name as the method's in
Style/MethodCallParentheses
. (@lumeet) - #2045: Fix crash in
Style/IndentationWidth
when usingprivate_class_method def self.foo
syntax. (@unmanbearpig) - #2006: Fix crash in
Style/FirstParameterIndentation
in case of nested offenses. (@unmanbearpig) - #2059: Don't check for trivial accessors in modules. (@bbatsov)
- Add proper punctuation to the end of offense messages, where it is missing. (@lumeet)
- #2071: Keep line breaks in place on WordArray autocorrect.(@unmanbearpig)
- #2075: Properly correct
Style/PercentLiteralDelimiters
with escape characters in them. (@rrosenblum) - #2023: Avoid auto-correction corruption in
IndentationWidth
. (@jonas054) - #2080: Properly parse code in
Performance/Count
when callingselect..count
in a class that extends an enumerable. (@rrosenblum) - #2093: Fix bug in
Style/OneLineConditional
which should not raise an offense with an 'if/then/end' statement. (@sliuu)