|
| 1 | +Nothing ground-breaking this time around, but the release is pretty exciting non-the-less. |
| 2 | +It packs a whole new category of cops (`Performance`) and a bunch of new Rails cops. |
| 3 | +A lot of the existing cops got new customization options and we squashed a ton of bugs. |
| 4 | + |
| 5 | +Thanks to everyone who contributed to this release! |
| 6 | + |
| 7 | +### New features |
| 8 | + |
| 9 | +* [#1600](https://github.com/bbatsov/rubocop/issues/1600): Add `line_count_based` and `semantic` styles to the `BlockDelimiters` (formerly `Blocks`) cop. ([@clowder][], [@mudge][]) |
| 10 | +* [#1712](https://github.com/bbatsov/rubocop/pull/1712): Set `Offense#corrected?` to `true`, `false`, or `nil` when it was, wasn't, or can't be auto-corrected, respectively. ([@vassilevsky][]) |
| 11 | +* [#1669](https://github.com/bbatsov/rubocop/pull/1669): Add command-line switch `--display-style-guide`. ([@marxarelli][]) |
| 12 | +* [#1405](https://github.com/bbatsov/rubocop/issues/1405): Add Rails TimeZone and Date cops. ([@palkan][]) |
| 13 | +* [#1641](https://github.com/bbatsov/rubocop/pull/1641): Add ruby19_no_mixed_keys style to `HashStyle` cop. ([@iainbeeston][]) |
| 14 | +* [#1604](https://github.com/bbatsov/rubocop/issues/1604): Add `IgnoreClassMethods` option to `TrivialAccessors` cop. ([@bbatsov][]) |
| 15 | +* [#1651](https://github.com/bbatsov/rubocop/issues/1651): The `Style/SpaceAroundOperators` cop now also detects extra spaces around operators. A list of operators that *may* be surrounded by multiple spaces is configurable. ([@bquorning][]) |
| 16 | +* Add auto-correct to `Encoding` cop. ([@rrosenblum][]) |
| 17 | +* [#1621](https://github.com/bbatsov/rubocop/issues/1621): `TrailingComma` has a new style `consistent_comma`. ([@tamird][]) |
| 18 | +* [#1611](https://github.com/bbatsov/rubocop/issues/1611): Add `empty`, `nil`, and `both` `SupportedStyles` to `EmptyElse` cop. Default is `both`. ([@rrosenblum][]) |
| 19 | +* [#1611](https://github.com/bbatsov/rubocop/issues/1611): Add new `MissingElse` cop. Default is to have this cop be disabled. ([@rrosenblum][]) |
| 20 | +* [#1602](https://github.com/bbatsov/rubocop/issues/1602): Add support for `# :nodoc` in `Documentation`. ([@lumeet][]) |
| 21 | +* [#1437](https://github.com/bbatsov/rubocop/issues/1437): Modify `HashSyntax` cop to allow the use of hash rockets for hashes that have symbol values when using ruby19 syntax. ([@rrosenblum][]) |
| 22 | +* New cop `Style/SymbolLiteral` makes sure you're not using the string within symbol syntax unless it's needed. ([@bbatsov][]) |
| 23 | +* [#1657](https://github.com/bbatsov/rubocop/issues/1657): Autocorrect can be turned off on a specific cop via the configuration. ([@jdoconnor][]) |
| 24 | +* New cop `Style/AutoResourceCleanup` suggests the use of block taking versions of methods that do resource cleanup. ([@bbatsov][]) |
| 25 | +* [#1275](https://github.com/bbatsov/rubocop/issues/1275): `WhileUntilModifier` cop does auto-correction. ([@lumeet][]) |
| 26 | +* New cop `Performance/ReverseEach` to convert `reverse.each` to `reverse_each`. ([@rrosenblum][]) |
| 27 | +* [#1281](https://github.com/bbatsov/rubocop/issues/1281): `IfUnlessModifier` cop does auto-correction. ([@lumeet][]) |
| 28 | +* New cop `Performance/Detect` to detect usage of `select.first`, `select.last`, `find_all.first`, and `find_all.last` and convert them to use `detect` instead. ([@palkan][], [@rrosenblum][]) |
| 29 | +* [#1728](https://github.com/bbatsov/rubocop/pull/1728): New cop `NonLocalExitFromIterator` checks for misused `return` in block. ([@ypresto][]) |
| 30 | +* New cop `Performance/Size` to convert calls to `count` on `Array` and `Hash` to `size`. ([@rrosenblum][]) |
| 31 | +* New cop `Performance/Sample` to convert usages of `shuffle.first`, `shuffle.last`, and `shuffle[Fixnum]` to `sample`. ([@rrosenblum][]) |
| 32 | +* New cop `Performance/FlatMap` to convert `Enumerable#map...Array#flatten` and `Enumerable#collect...Array#flatten` to `Enumerable#flat_map`. ([@rrosenblum][]) |
| 33 | +* [#1144](https://github.com/bbatsov/rubocop/issues/1144): New cop `ClosingParenthesisIndentation` checks the indentation of hanging closing parentheses. ([@jonas054][]) |
| 34 | +* New Rails cop `FindBy` identifies usages of `where.first` and `where.take`. ([@bbatsov][]) |
| 35 | +* New Rails cop `FindEach` identifies usages of `all.each`. ([@bbatsov][]) |
| 36 | +* [#1342](https://github.com/bbatsov/rubocop/issues/1342): `IndentationConsistency` is now configurable with the styles `normal` and `rails`. ([@jonas054][]) |
| 37 | + |
| 38 | +### Bugs fixed |
| 39 | + |
| 40 | +* [#1705](https://github.com/bbatsov/rubocop/issues/1705): Fix crash when reporting offenses of `MissingElse` cop. ([@gerry3][]) |
| 41 | +* [#1659](https://github.com/bbatsov/rubocop/pull/1659): Fix stack overflow with JRuby and Windows 8, during initial config validation. ([@pimterry][]) |
| 42 | +* [#1694](https://github.com/bbatsov/rubocop/issues/1694): Ignore methods with a `blockarg` in `TrivialAccessors`. ([@bbatsov][]) |
| 43 | +* [#1617](https://github.com/bbatsov/rubocop/issues/1617): Always read the html output template using utf-8. ([@bbatsov][]) |
| 44 | +* [#1684](https://github.com/bbatsov/rubocop/issues/1684): Ignore symbol keys like `:"string"` in `HashSyntax`. ([@bbatsov][]) |
| 45 | +* Handle explicit `begin` blocks in `Lint/Void`. ([@bbatsov][]) |
| 46 | +* Handle symbols in `Lint/Void`. ([@bbatsov][]) |
| 47 | +* [#1695](https://github.com/bbatsov/rubocop/pull/1695): Fix bug with `--auto-gen-config` and `SpaceInsideBlockBraces`. ([@meganemura][]) |
| 48 | +* Correct issues with whitespace around multi-line lambda arguments. ([@zvkemp][]) |
| 49 | +* [#1579](https://github.com/bbatsov/rubocop/issues/1579): Fix handling of similar-looking blocks in `BlockAlignment`. ([@lumeet][]) |
| 50 | +* [#1676](https://github.com/bbatsov/rubocop/pull/1676): Fix auto-correct in `Lambda` when a new multi-line lambda is used as an argument. ([@lumeet][]) |
| 51 | +* [#1656](https://github.com/bbatsov/rubocop/issues/1656): Fix bug that would include hidden directories implicitly. ([@jonas054][]) |
| 52 | +* [#1728](https://github.com/bbatsov/rubocop/pull/1728): Fix bug in `LiteralInInterpolation` and `AssignmentInCondition`. ([@ypresto][]) |
| 53 | +* [#1735](https://github.com/bbatsov/rubocop/issues/1735): Handle trailing space in `LineEndConcatenation` autocorrect. ([@jonas054][]) |
| 54 | +* [#1750](https://github.com/bbatsov/rubocop/issues/1750): Escape offending code lines output by the HTML formatter in case they contain markup. ([@jonas054][]) |
| 55 | +* [#1541](https://github.com/bbatsov/rubocop/issues/1541): No inspection of text that follows `__END__`. ([@jonas054][]) |
| 56 | +* Fix comment detection in `Style/Documentation`. ([@lumeet][]) |
| 57 | +* [#1637](https://github.com/bbatsov/rubocop/issues/1637): Fix handling of `binding` calls in `UnusedBlockArgument` and `UnusedMethodArgument`. ([@lumeet][]) |
| 58 | + |
| 59 | +### Changes |
| 60 | + |
| 61 | +* [#1397](https://github.com/bbatsov/rubocop/issues/1397): `UnneededPercentX` renamed to `CommandLiteral`. The cop can be configured to enforce using either `%x` or backticks around command literals, or using `%x` around multi-line commands and backticks around single-line commands. The cop ignores heredoc commands. ([@bquorning][]) |
| 62 | +* [#1020](https://github.com/bbatsov/rubocop/issues/1020): Removed the `MaxSlashes` configuration option for `RegexpLiteral`. Instead, the cop can be configured to enforce using either `%r` or slashes around regular expressions, or using `%r` around multi-line regexes and slashes around single-line regexes. ([@bquorning][]) |
| 63 | +* [#1734](https://github.com/bbatsov/rubocop/issues/1734): The default exclusion of hidden directories has been optimized for speed. ([@jonas054][]) |
| 64 | +* [#1673](https://github.com/bbatsov/rubocop/issues/1673): `Style/TrivialAccessors` now requires matching names by default. ([@bbatsov][]) |
| 65 | + |
| 66 | +[@bbatsov]: https://github.com/bbatsov |
| 67 | +[@jonas054]: https://github.com/jonas054 |
| 68 | +[@yujinakayama]: https://github.com/yujinakayama |
| 69 | +[@dblock]: https://github.com/dblock |
| 70 | +[@nevir]: https://github.com/nevir |
| 71 | +[@daviddavis]: https://github.com/daviddavis |
| 72 | +[@sds]: https://github.com/sds |
| 73 | +[@fancyremarker]: https://github.com/fancyremarker |
| 74 | +[@sinisterchipmunk]: https://github.com/sinisterchipmunk |
| 75 | +[@vonTronje]: https://github.com/vonTronje |
| 76 | +[@agrimm]: https://github.com/agrimm |
| 77 | +[@pmenglund]: https://github.com/pmenglund |
| 78 | +[@chulkilee]: https://github.com/chulkilee |
| 79 | +[@codez]: https://github.com/codez |
| 80 | +[@emou]: https://github.com/emou |
| 81 | +[@skanev]: http://github.com/skanev |
| 82 | +[@claco]: http://github.com/claco |
| 83 | +[@rifraf]: http://github.com/rifraf |
| 84 | +[@scottmatthewman]: https://github.com/scottmatthewman |
| 85 | +[@ma2gedev]: http://github.com/ma2gedev |
| 86 | +[@jeremyolliver]: https://github.com/jeremyolliver |
| 87 | +[@hannestyden]: https://github.com/hannestyden |
| 88 | +[@geniou]: https://github.com/geniou |
| 89 | +[@jkogara]: https://github.com/jkogara |
| 90 | +[@tmorris-fiksu]: https://github.com/tmorris-fiksu |
| 91 | +[@mockdeep]: https://github.com/mockdeep |
| 92 | +[@hiroponz]: https://github.com/hiroponz |
| 93 | +[@tamird]: https://github.com/tamird |
| 94 | +[@fshowalter]: https://github.com/fshowalter |
| 95 | +[@cschramm]: https://github.com/cschramm |
| 96 | +[@bquorning]: https://github.com/bquorning |
| 97 | +[@bcobb]: https://github.com/bcobb |
| 98 | +[@irrationalfab]: https://github.com/irrationalfab |
| 99 | +[@tommeier]: https://github.com/tommeier |
| 100 | +[@sfeldon]: https://github.com/sfeldon |
| 101 | +[@biinari]: https://github.com/biinari |
| 102 | +[@barunio]: https://github.com/barunio |
| 103 | +[@molawson]: https://github.com/molawson |
| 104 | +[@wndhydrnt]: https://github.com/wndhydrnt |
| 105 | +[@ggilder]: https://github.com/ggilder |
| 106 | +[@salbertson]: https://github.com/salbertson |
| 107 | +[@camilleldn]: https://github.com/camilleldn |
| 108 | +[@mcls]: https://github.com/mcls |
| 109 | +[@yous]: https://github.com/yous |
| 110 | +[@vrthra]: https://github.com/vrthra |
| 111 | +[@SkuliOskarsson]: https://github.com/SkuliOskarsson |
| 112 | +[@jspanjers]: https://github.com/jspanjers |
| 113 | +[@sch1zo]: https://github.com/sch1zo |
| 114 | +[@smangelsdorf]: https://github.com/smangelsdorf |
| 115 | +[@mvz]: https://github.com/mvz |
| 116 | +[@jfelchner]: https://github.com/jfelchner |
| 117 | +[@janraasch]: https://github.com/janraasch |
| 118 | +[@jcarbo]: https://github.com/jcarbo |
| 119 | +[@oneamtu]: https://github.com/oneamtu |
| 120 | +[@toy]: https://github.com/toy |
| 121 | +[@Koronen]: https://github.com/Koronen |
| 122 | +[@blainesch]: https://github.com/blainesch |
| 123 | +[@marxarelli]: https://github.com/marxarelli |
| 124 | +[@katieschilling]: https://github.com/katieschilling |
| 125 | +[@kakutani]: https://github.com/kakutani |
| 126 | +[@rrosenblum]: https://github.com/rrosenblum |
| 127 | +[@mattjmcnaughton]: https://github.com/mattjmcnaughton |
| 128 | +[@huerlisi]: https://github.com/huerlisi |
| 129 | +[@volkert]: https://github.com/volkert |
| 130 | +[@lumeet]: https://github.com/lumeet |
| 131 | +[@mmozuras]: https://github.com/mmozuras |
| 132 | +[@d4rk5eed]: https://github.com/d4rk5eed |
| 133 | +[@cshaffer]: https://github.com/cshaffer |
| 134 | +[@eitoball]: https://github.com/eitoball |
| 135 | +[@iainbeeston]: https://github.com/iainbeeston |
| 136 | +[@pimterry]: https://github.com/pimterry |
| 137 | +[@palkan]: https://github.com/palkan |
| 138 | +[@jdoconnor]: https://github.com/jdoconnor |
| 139 | +[@meganemura]: https://github.com/meganemura |
| 140 | +[@zvkemp]: https://github.com/zvkemp |
| 141 | +[@vassilevsky]: https://github.com/vassilevsky |
| 142 | +[@gerry3]: https://github.com/gerry3 |
| 143 | +[@ypresto]: https://github.com/ypresto |
| 144 | +[@clowder]: https://github.com/clowder |
| 145 | +[@mudge]: https://github.com/mudge |
0 commit comments