### New features * [#2081](https://github.com/bbatsov/rubocop/pull/2081): New cop `Style/Send` checks for the use of `send` and instead encourages changing it to `BasicObject#__send__` or `Object#public_send` (disabled by default). ([@syndbg][]) * [#2057](https://github.com/bbatsov/rubocop/pull/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](https://github.com/bbatsov/rubocop/pull/2010): Add `space` style for SpaceInsideStringInterpolation. ([@gotrevor][]) * [#2007](https://github.com/bbatsov/rubocop/pull/2007): Allow any modifier before `def`, not only visibility modifiers. ([@fphilipe][]) * [#1980](https://github.com/bbatsov/rubocop/pull/1980): `--auto-gen-config` now outputs an excluded files list for failed cops (up to a maxiumum of 15 files). ([@bmorrall][]) * [#2004](https://github.com/bbatsov/rubocop/pull/2004): Introduced `--exclude-limit COUNT` to configure how many files `--auto-gen-config` will exclude. ([@awwaiid][], [@jonas054][]) * [#1918](https://github.com/bbatsov/rubocop/issues/1918): New configuration parameter `AllCops:DisabledByDefault` when set to `true` makes only cops found in user configuration enabled, which makes cop selection *opt-in*. ([@jonas054][]) * New cop `Performance/StringReplacement` checks for usages of `gsub` that can be replaced with `tr` or `delete`. ([@rrosenblum][]) * [#2001](https://github.com/bbatsov/rubocop/issues/2001): New cop `Style/InitialIndentation` checks for indentation of the first non-blank non-comment line in a file. ([@jonas054][]) * [#2060](https://github.com/bbatsov/rubocop/issues/2060): New cop `Style/RescueEnsureAlignment` checks for bad alignment of `rescue` and `ensure` 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](https://github.com/bbatsov/rubocop/issues/2030): New cop `Lint/OptionHash` checks for option hashes and encourages changing them to keyword arguments (disabled by default). ([@maxjacobson][]) ### Changes * [#2052](https://github.com/bbatsov/rubocop/pull/2052): `Style/RescueModifier` uses token stream to identify offenses. ([@urbanautomaton][]) * Rename `Rails/Date` and `Rails/TimeZone` style names to "strict" and "flexible" and make "flexible" to be default. ([@palkan][]) * [#2035](https://github.com/bbatsov/rubocop/issues/2035): `Style/ExtraSpacing` is now enabled by default and has a configuration parameter `AllowForAlignment` that is `true` by default, making it allow extra spacing if it's used for alignment purposes. ([@jonas054][]) ### Bugs fixed * [#2014](https://github.com/bbatsov/rubocop/pull/2014): Fix `Style/TrivialAccessors` to support AllowPredicates: false. ([@gotrevor][]) * [#1988](https://github.com/bbatsov/rubocop/issues/1988): Fix bug in `Style/ParallelAssignment` when assigning from `Module::CONSTANT`. ([@rrosenblum][]) * [#1995](https://github.com/bbatsov/rubocop/pull/1995): Improve message for `Rails/TimeZone`. ([@palkan][]) * [#1977](https://github.com/bbatsov/rubocop/issues/1977): Fix bugs in `Rails/Date` and `Rails/TimeZone` when using namespaced Time/Date. ([@palkan][]) * [#1973](https://github.com/bbatsov/rubocop/issues/1973): Do not register an offense in `Performance/Detect` when `select` is called on `Enumerable::Lazy`. ([@palkan][]) * [#2015](https://github.com/bbatsov/rubocop/issues/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](https://github.com/bbatsov/rubocop/issues/2026): Allow `Time.current` when style is "acceptable".([@palkan][]) * [#2029](https://github.com/bbatsov/rubocop/issues/2029): Fix bug where `Style/RedundantReturn` auto-corrects returning implicit hashes to invalid syntax. ([@rrosenblum][]) * [#2021](https://github.com/bbatsov/rubocop/issues/2021): Fix bug in `Style/BlockDelimiters` when a `semantic` expression is used in an array or a range. ([@lumeet][]) * [#1992](https://github.com/bbatsov/rubocop/issues/1992): Allow parentheses in assignment to a variable with the same name as the method's in `Style/MethodCallParentheses`. ([@lumeet][]) * [#2045](https://github.com/bbatsov/rubocop/issues/2045): Fix crash in `Style/IndentationWidth` when using `private_class_method def self.foo` syntax. ([@unmanbearpig][]) * [#2006](https://github.com/bbatsov/rubocop/issues/2006): Fix crash in `Style/FirstParameterIndentation` in case of nested offenses. ([@unmanbearpig][]) * [#2059](https://github.com/bbatsov/rubocop/issues/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](https://github.com/bbatsov/rubocop/pull/2071): Keep line breaks in place on WordArray autocorrect.([@unmanbearpig][]) * [#2075](https://github.com/bbatsov/rubocop/pull/2075): Properly correct `Style/PercentLiteralDelimiters` with escape characters in them. ([@rrosenblum][]) * [#2023](https://github.com/bbatsov/rubocop/issues/2023): Avoid auto-correction corruption in `IndentationWidth`. ([@jonas054][]) * [#2080](https://github.com/bbatsov/rubocop/issues/2080): Properly parse code in `Performance/Count` when calling `select..count` in a class that extends an enumerable. ([@rrosenblum][]) * [#2093](https://github.com/bbatsov/rubocop/issues/2093): Fix bug in `Style/OneLineConditional` which should not raise an offense with an 'if/then/end' statement. ([@sliuu][]) [@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