Apart from the usual myriad of bugfixes, improvements and new cops, this version introduces a results caching functionality. This functionality will speed up tremendously consecutive RuboCop runs on the same codebase. Another news to share with you - the project now has a crowdfunding campaign [here](https://salt.bountysource.com/). If you like RuboCop you might consider supporting its development. Enjoy! ### New features * [#2143](https://github.com/bbatsov/rubocop/pull/2143): New cop `Performance/CaseWhenSplat` will identify and rearange `case` `when` statements that contain a `when` condition with a splat. ([@rrosenblum][]) * New cop `Lint/DuplicatedKey` checks for duplicated keys in hashes, which Ruby 2.2 warns against. ([@sliuu][]) * [#2106](https://github.com/bbatsov/rubocop/issues/2106): Add `SuspiciousParamNames` option to `Style/OptionHash`. ([@wli][]) * [#2193](https://github.com/bbatsov/rubocop/pull/2193): `Style/Next` supports more `Enumerable` methods. ([@rrosenblum][]) * [#2179](https://github.com/bbatsov/rubocop/issues/2179): Add `--list-target-files` option to CLI, which prints the files which will be inspected. ([@maxjacobson][]) * New cop `Style/MutableConstant` checks for assignment of mutable objects to constants. ([@bbatsov][]) * New cop `Style/RedudantFreeze` checks for usages of `Object#freeze` on immutable objects. ([@bbatsov][]) * [#1924](https://github.com/bbatsov/rubocop/issues/1924): New option `--cache` and configuration parameter `AllCops: UseCache` turn result caching on (default) or off. ([@jonas054][]) * [#2204](https://github.com/bbatsov/rubocop/pull/2204): New cop `Style/StringMethods` will check for preferred method `to_sym` over `intern`. ([@imtayadeway][]) ### Changes * [#1351](https://github.com/bbatsov/rubocop/issues/1351): Allow class emitter methods in `Style/MethodName`. ([@jonas054][]) * [#2126](https://github.com/bbatsov/rubocop/pull/2126): `Style/RescueModifier` can now auto-correct. ([@rrosenblum][]) * [#2109](https://github.com/bbatsov/rubocop/issues/2109): Allow alignment with a token on the nearest line with same indentation in `Style/ExtraSpacing`. ([@jonas054][]) * `Lint/EndAlignment` handles the `case` keyword. ([@lumeet][]) * [#2146](https://github.com/bbatsov/rubocop/pull/2146): Add STDIN support. ([@caseywebdev][]) * [#2175](https://github.com/bbatsov/rubocop/pull/2175): Files that are excluded from a cop (e.g. using the `Exclude:` config option) are no longer being processed by that cop. ([@bquorning][]) * `Rails/ActionFilter` now handles complete list of methods found in the Rails 4.2 [release notes](https://github.com/rails/rails/blob/4115a12da1409c753c747fd4bab6e612c0c6e51a/guides/source/4_2_release_notes.md#notable-changes-1). ([@MGerrior][]) * [*2138](https://github.com/bbatsov/rubocop/issues/2138): Change the offense in `Style/Next` to highlight the condition instead of the iteration. ([@rrosenblum][]) * `Style/EmptyLineBetweenDefs` now handles class methods as well. ([@unmanbearpig][]) * Improve handling of `super` in `Style/SymbolProc`. ([@lumeet][]) * `Style/SymbolProc` is applied to methods receiving arguments. ([@lumeet][]) * [#1839](https://github.com/bbatsov/rubocop/issues/1839): Remove Rainbow monkey patching of String which conflicts with other gems like colorize. ([@daviddavis][]) * `Style/HashSyntax` is now a bit faster when checking Ruby 1.9 syntax hash keys. ([@bquorning][]) * `Lint/DeprecatedClassMethods` is now a whole lot faster. ([@bquorning][]) * `Lint/BlockAlignment`, `Style/IndentationWidth`, and `Style/MultilineOperationIndentation` are now quite a bit faster. ([@bquorning][]) ### Bug Fixes * [#2123](https://github.com/bbatsov/rubocop/pull/2123): Fix handing of dynamic widths `Lint/FormatParameterMismatch`. ([@edmz][]) * [#2116](https://github.com/bbatsov/rubocop/pull/2116): Fix named params (using hash) `Lint/FormatParameterMismatch`. ([@edmz][]) * [#2135](https://github.com/bbatsov/rubocop/issues/2135): Ignore `super` and `zsuper` nodes in `Style/SymbolProc`. ([@bbatsov][]) * [#2165](https://github.com/bbatsov/rubocop/issues/2165): Fix a NPE in `Style/Alias`. ([@bbatsov][]) * [#2168](https://github.com/bbatsov/rubocop/issues/2168): Fix a NPE in `Rails/TimeZone`. ([@bbatsov][]) * [#2169](https://github.com/bbatsov/rubocop/issues/2169): Fix a NPE in `Rails/Date`. ([@bbatsov][]) * [#2105](https://github.com/bbatsov/rubocop/pull/2105): Fix a warning that was thrown when enabling `Style/OptionHash`. ([@wli][]) * [#2107](https://github.com/bbatsov/rubocop/pull/2107): Fix auto-correct of `Style/ParallelAssignment` for nested expressions. ([@rrosenblum][]) * [#2111](https://github.com/bbatsov/rubocop/issues/2111): Deal with byte order mark in `Style/InitialIndentation`. ([@jonas054][]) * [#2113](https://github.com/bbatsov/rubocop/issues/2113): Handle non-string tokens in `Style/ExtraSpacing`. ([@jonas054][]) * [#2129](https://github.com/bbatsov/rubocop/issues/2129): Handle empty interpolations in `Style/SpaceInsideStringInterpolation`. ([@lumeet][]) * [#2119](https://github.com/bbatsov/rubocop/issues/2119): Do not raise an error in `Style/RescueEnsureAlignment` and `Style/RescueModifier` when processing an excluded file. ([@rrosenblum][]) * [#2149](https://github.com/bbatsov/rubocop/issues/2149): Do not register an offense in `Rails/Date` when `Date#to_time` is called with a time zone argument. ([@maxjacobson][]) * Do not register a `Rails/TimeZone` offense when using Time.new safely. ([@maxjacobson][]) * [#2124](https://github.com/bbatsov/rubocop/issues/2124): Fix bug in `Style/EmptyLineBetweenDefs` when there are only comments between method definitions. ([@lumeet][]) * [#2154](https://github.com/bbatsov/rubocop/issues/2154): `Performance/StringReplacement` can auto-correct replacements with backslash in them. ([@rrosenblum][]) * [#2009](https://github.com/bbatsov/rubocop/issues/2009): Fix bug in `RuboCop::ConfigLoader.load_file` when `safe_yaml` is required. ([@eitoball][]) * [#2155](https://github.com/bbatsov/rubocop/issues/2155): Configuration `EndAlignment: AlignWith: variable` only applies when the operands of `=` are on the same line. ([@jonas054][]) * Fix bug in `Style/IndentationWidth` when `rescue` or `ensure` is preceded by an empty body. ([@lumeet][]) * [#2183](https://github.com/bbatsov/rubocop/issues/2183): Fix bug in `Style/BlockDelimiters` when auto-correcting adjacent braces. ([@lumeet][]) * [#2199](https://github.com/bbatsov/rubocop/issues/2199): Make `rubocop` exit with error when there are only `Lint/UnneededDisable` offenses. ([@jonas054][]) * Fix handling of empty parentheses when auto-correcting in `Style/SymbolProc`. ([@lumeet][]) [@bbatsov]: https://github.com/bbatsov [@jonas054]: https://github.com/jonas054 [@yujinakayama]: https://github.com/yujinakayama [@dblock]: https://github.com/dblock [@nevir]: https://github.com/nevir [@daviddavis]: https://github.com/daviddavis [@sds]: https://github.com/sds [@fancyremarker]: https://github.com/fancyremarker [@sinisterchipmunk]: https://github.com/sinisterchipmunk [@vonTronje]: https://github.com/vonTronje [@agrimm]: https://github.com/agrimm [@pmenglund]: https://github.com/pmenglund [@chulkilee]: https://github.com/chulkilee [@codez]: https://github.com/codez [@emou]: https://github.com/emou [@skanev]: http://github.com/skanev [@claco]: http://github.com/claco [@rifraf]: http://github.com/rifraf [@scottmatthewman]: https://github.com/scottmatthewman [@ma2gedev]: http://github.com/ma2gedev [@jeremyolliver]: https://github.com/jeremyolliver [@hannestyden]: https://github.com/hannestyden [@geniou]: https://github.com/geniou [@jkogara]: https://github.com/jkogara [@tmorris-fiksu]: https://github.com/tmorris-fiksu [@mockdeep]: https://github.com/mockdeep [@hiroponz]: https://github.com/hiroponz [@tamird]: https://github.com/tamird [@fshowalter]: https://github.com/fshowalter [@cschramm]: https://github.com/cschramm [@bquorning]: https://github.com/bquorning [@bcobb]: https://github.com/bcobb [@irrationalfab]: https://github.com/irrationalfab [@tommeier]: https://github.com/tommeier [@sfeldon]: https://github.com/sfeldon [@biinari]: https://github.com/biinari [@barunio]: https://github.com/barunio [@molawson]: https://github.com/molawson [@wndhydrnt]: https://github.com/wndhydrnt [@ggilder]: https://github.com/ggilder [@salbertson]: https://github.com/salbertson [@camilleldn]: https://github.com/camilleldn [@mcls]: https://github.com/mcls [@yous]: https://github.com/yous [@vrthra]: https://github.com/vrthra [@SkuliOskarsson]: https://github.com/SkuliOskarsson [@jspanjers]: https://github.com/jspanjers [@sch1zo]: https://github.com/sch1zo [@smangelsdorf]: https://github.com/smangelsdorf [@mvz]: https://github.com/mvz [@jfelchner]: https://github.com/jfelchner [@janraasch]: https://github.com/janraasch [@jcarbo]: https://github.com/jcarbo [@oneamtu]: https://github.com/oneamtu [@toy]: https://github.com/toy [@Koronen]: https://github.com/Koronen [@blainesch]: https://github.com/blainesch [@marxarelli]: https://github.com/marxarelli [@katieschilling]: https://github.com/katieschilling [@kakutani]: https://github.com/kakutani [@rrosenblum]: https://github.com/rrosenblum [@mattjmcnaughton]: https://github.com/mattjmcnaughton [@huerlisi]: https://github.com/huerlisi [@volkert]: https://github.com/volkert [@lumeet]: https://github.com/lumeet [@mmozuras]: https://github.com/mmozuras [@d4rk5eed]: https://github.com/d4rk5eed [@cshaffer]: https://github.com/cshaffer [@eitoball]: https://github.com/eitoball [@iainbeeston]: https://github.com/iainbeeston [@pimterry]: https://github.com/pimterry [@palkan]: https://github.com/palkan [@jdoconnor]: https://github.com/jdoconnor [@meganemura]: https://github.com/meganemura [@zvkemp]: https://github.com/zvkemp [@vassilevsky]: https://github.com/vassilevsky [@gerry3]: https://github.com/gerry3 [@ypresto]: https://github.com/ypresto [@clowder]: https://github.com/clowder [@mudge]: https://github.com/mudge [@mzp]: https://github.com/mzp [@bankair]: https://github.com/bankair [@crimsonknave]: https://github.com/crimsonknave [@renuo]: https://github.com/renuo [@sdeframond]: https://github.com/sdeframond [@til]: https://github.com/til [@carhartl]: https://github.com/carhartl [@dylandavidson]: https://github.com/dylandavidson [@tmr08c]: https://github.com/tmr08c [@hbd225]: https://github.com/hbd225 [@l8nite]: https://github.com/l8nite [@sumeet]: https://github.com/sumeet [@ojab]: https://github.com/ojab [@chastell]: https://github.com/chastell [@glasnt]: https://github.com/glasnt [@crazydog115]: https://github.com/crazydog115 [@RGBD]: https://github.com/RGBD [@panthomakos]: https://github.com/panthomakos [@matugm]: https://github.com/matugm [@m1foley]: https://github.com/m1foley [@tejasbubane]: https://github.com/tejasbubane [@bmorrall]: https://github.com/bmorrall [@fphilipe]: https://github.com/fphilipe [@gotrevor]: https://github.com/gotrevor [@awwaiid]: https://github.com/awwaiid [@segiddins]: https://github.com/segiddins [@urbanautomaton]: https://github.com/urbanautomaton.com [@unmanbearpig]: https://github.com/unmanbearpig [@maxjacobson]: https://github.com/maxjacobson [@sliuu]: https://github.com/sliuu [@edmz]: https://github.com/edmz [@syndbg]: https://github.com/syndbg [@wli]: https://github.com/wli [@caseywebdev]: https://github.com/caseywebdev [@MGerrior]: https://github.com/MGerrior [@imtayadeway]: https://github.com/imtayadeway