rubocop 0.37.0 → 0.37.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of rubocop might be problematic. Click here for more details.

Files changed (74) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/config/default.yml +2 -3
  4. data/config/enabled.yml +2 -2
  5. data/lib/rubocop.rb +2 -1
  6. data/lib/rubocop/ast_node.rb +34 -17
  7. data/lib/rubocop/ast_node/traversal.rb +2 -1
  8. data/lib/rubocop/config.rb +1 -1
  9. data/lib/rubocop/cop/commissioner.rb +5 -5
  10. data/lib/rubocop/cop/corrector.rb +17 -3
  11. data/lib/rubocop/cop/lint/debugger.rb +2 -2
  12. data/lib/rubocop/cop/lint/nested_method_definition.rb +5 -1
  13. data/lib/rubocop/cop/lint/unneeded_disable.rb +1 -1
  14. data/lib/rubocop/cop/metrics/parameter_lists.rb +1 -1
  15. data/lib/rubocop/cop/performance/redundant_match.rb +2 -1
  16. data/lib/rubocop/cop/performance/redundant_merge.rb +1 -2
  17. data/lib/rubocop/cop/rails/find_each.rb +1 -1
  18. data/lib/rubocop/cop/style/block_end_newline.rb +1 -1
  19. data/lib/rubocop/cop/style/conditional_assignment.rb +25 -7
  20. data/lib/rubocop/cop/style/empty_line_between_defs.rb +13 -7
  21. data/lib/rubocop/cop/style/frozen_string_literal_comment.rb +1 -12
  22. data/lib/rubocop/cop/style/guard_clause.rb +3 -1
  23. data/lib/rubocop/cop/style/initial_indentation.rb +1 -1
  24. data/lib/rubocop/cop/style/line_end_concatenation.rb +1 -1
  25. data/lib/rubocop/cop/style/multiline_block_layout.rb +14 -12
  26. data/lib/rubocop/cop/style/not.rb +1 -1
  27. data/lib/rubocop/cop/style/semicolon.rb +14 -7
  28. data/lib/rubocop/cop/style/space_around_keyword.rb +13 -4
  29. data/lib/rubocop/cop/style/space_around_operators.rb +2 -2
  30. data/lib/rubocop/cop/style/trailing_underscore_variable.rb +32 -27
  31. data/lib/rubocop/cop/style/word_array.rb +1 -1
  32. data/lib/rubocop/cop/team.rb +20 -9
  33. data/lib/rubocop/cop/util.rb +4 -5
  34. data/lib/rubocop/formatter/formatter_set.rb +3 -3
  35. data/lib/rubocop/version.rb +1 -1
  36. metadata +5 -43
  37. data/.yardopts +0 -2
  38. data/CHANGELOG.md +0 -1941
  39. data/CONTRIBUTING.md +0 -68
  40. data/assets/logo.png +0 -0
  41. data/assets/output.html.erb +0 -247
  42. data/logo/rubo-logo-horizontal.png +0 -0
  43. data/logo/rubo-logo-square.png +0 -0
  44. data/logo/rubo-logo-symbol.png +0 -0
  45. data/relnotes/v0.19.0.md +0 -94
  46. data/relnotes/v0.19.1.md +0 -16
  47. data/relnotes/v0.20.0.md +0 -69
  48. data/relnotes/v0.20.1.md +0 -24
  49. data/relnotes/v0.21.0.md +0 -56
  50. data/relnotes/v0.22.0.md +0 -77
  51. data/relnotes/v0.23.0.md +0 -79
  52. data/relnotes/v0.24.0.md +0 -77
  53. data/relnotes/v0.24.1.md +0 -15
  54. data/relnotes/v0.25.0.md +0 -91
  55. data/relnotes/v0.26.0.md +0 -89
  56. data/relnotes/v0.26.1.md +0 -12
  57. data/relnotes/v0.27.0.md +0 -77
  58. data/relnotes/v0.27.1.md +0 -66
  59. data/relnotes/v0.28.0.md +0 -90
  60. data/relnotes/v0.29.0.md +0 -116
  61. data/relnotes/v0.29.1.md +0 -12
  62. data/relnotes/v0.30.0.md +0 -145
  63. data/relnotes/v0.30.1.md +0 -103
  64. data/relnotes/v0.31.0.md +0 -120
  65. data/relnotes/v0.32.0.md +0 -139
  66. data/relnotes/v0.32.1.md +0 -122
  67. data/relnotes/v0.33.0.md +0 -157
  68. data/relnotes/v0.34.0.md +0 -182
  69. data/relnotes/v0.34.1.md +0 -129
  70. data/relnotes/v0.34.2.md +0 -139
  71. data/relnotes/v0.35.0.md +0 -210
  72. data/relnotes/v0.36.0.md +0 -307
  73. data/relnotes/v0.37.0.md +0 -200
  74. data/rubocop.gemspec +0 -49
@@ -1,139 +0,0 @@
1
- ### Bug Fixes
2
-
3
- * [#2232](https://github.com/bbatsov/rubocop/issues/2232): Fix false positive in `Lint/FormatParameterMismatch` for argument with splat operator. ([@dreyks][])
4
- * [#2237](https://github.com/bbatsov/rubocop/pull/2237): Allow `Lint/FormatParameterMismatch` to be called using `Kernel.format` and `Kernel.sprintf`. ([@rrosenblum][])
5
- * [#2234](https://github.com/bbatsov/rubocop/issues/2234): Do not register an offense for `Lint/FormatParameterMismatch` when the format string is a variable. ([@rrosenblum][])
6
- * [#2240](https://github.com/bbatsov/rubocop/pull/2240): `Lint/UnneededDisable` should not report non-`Lint` `rubocop:disable` comments when running `rubocop --lint`. ([@jonas054][])
7
- * [#2121](https://github.com/bbatsov/rubocop/issues/2121): Allow space before values in hash literals in `Style/ExtraSpacing` to avoid correction conflict. ([@jonas054][])
8
- * [#2241](https://github.com/bbatsov/rubocop/issues/2241): Read cache in binary format. ([@jonas054][])
9
- * [#2247](https://github.com/bbatsov/rubocop/issues/2247): Fix auto-correct of `Performance/CaseWhenSplat` for percent arrays (`%w`, `%W`, `%i`, and `%I`). ([@rrosenblum][])
10
- * [#2244](https://github.com/bbatsov/rubocop/issues/2244): Disregard annotation keywords in `Style/CommentAnnotation` if they don't start a comment. ([@jonas054][])
11
- * [#2257](https://github.com/bbatsov/rubocop/pull/2257): Fix bug where `Style/RescueEnsureAlignment` will register an offense for `rescue` and `ensure` on the same line. ([@rrosenblum][])
12
- * [#2255](https://github.com/bbatsov/rubocop/issues/2255): Refine the offense highlighting for `Style/SymbolProc`. ([@bbatsov][])
13
- * [#2260](https://github.com/bbatsov/rubocop/pull/2260): Make `Exclude` in `.rubocop_todo.yml` work when running from a subdirectory. ([@jonas054][])
14
-
15
- ### Changes
16
-
17
- * [#2248](https://github.com/bbatsov/rubocop/issues/2248): Allow block-pass in `Style/AutoResourceCleanup`. ([@lumeet][])
18
- * [#2258](https://github.com/bbatsov/rubocop/pull/2258): `Style/Documentation` will exclude test directories by default. ([@rrosenblum][])
19
- * [#2260](https://github.com/bbatsov/rubocop/issues/2260): Disable `Style/StringMethods` by default. ([@bbatsov][])
20
-
21
- [@bbatsov]: https://github.com/bbatsov
22
- [@jonas054]: https://github.com/jonas054
23
- [@yujinakayama]: https://github.com/yujinakayama
24
- [@dblock]: https://github.com/dblock
25
- [@nevir]: https://github.com/nevir
26
- [@daviddavis]: https://github.com/daviddavis
27
- [@sds]: https://github.com/sds
28
- [@fancyremarker]: https://github.com/fancyremarker
29
- [@sinisterchipmunk]: https://github.com/sinisterchipmunk
30
- [@vonTronje]: https://github.com/vonTronje
31
- [@agrimm]: https://github.com/agrimm
32
- [@pmenglund]: https://github.com/pmenglund
33
- [@chulkilee]: https://github.com/chulkilee
34
- [@codez]: https://github.com/codez
35
- [@emou]: https://github.com/emou
36
- [@skanev]: http://github.com/skanev
37
- [@claco]: http://github.com/claco
38
- [@rifraf]: http://github.com/rifraf
39
- [@scottmatthewman]: https://github.com/scottmatthewman
40
- [@ma2gedev]: http://github.com/ma2gedev
41
- [@jeremyolliver]: https://github.com/jeremyolliver
42
- [@hannestyden]: https://github.com/hannestyden
43
- [@geniou]: https://github.com/geniou
44
- [@jkogara]: https://github.com/jkogara
45
- [@tmorris-fiksu]: https://github.com/tmorris-fiksu
46
- [@mockdeep]: https://github.com/mockdeep
47
- [@hiroponz]: https://github.com/hiroponz
48
- [@tamird]: https://github.com/tamird
49
- [@fshowalter]: https://github.com/fshowalter
50
- [@cschramm]: https://github.com/cschramm
51
- [@bquorning]: https://github.com/bquorning
52
- [@bcobb]: https://github.com/bcobb
53
- [@irrationalfab]: https://github.com/irrationalfab
54
- [@tommeier]: https://github.com/tommeier
55
- [@sfeldon]: https://github.com/sfeldon
56
- [@biinari]: https://github.com/biinari
57
- [@barunio]: https://github.com/barunio
58
- [@molawson]: https://github.com/molawson
59
- [@wndhydrnt]: https://github.com/wndhydrnt
60
- [@ggilder]: https://github.com/ggilder
61
- [@salbertson]: https://github.com/salbertson
62
- [@camilleldn]: https://github.com/camilleldn
63
- [@mcls]: https://github.com/mcls
64
- [@yous]: https://github.com/yous
65
- [@vrthra]: https://github.com/vrthra
66
- [@SkuliOskarsson]: https://github.com/SkuliOskarsson
67
- [@jspanjers]: https://github.com/jspanjers
68
- [@sch1zo]: https://github.com/sch1zo
69
- [@smangelsdorf]: https://github.com/smangelsdorf
70
- [@mvz]: https://github.com/mvz
71
- [@jfelchner]: https://github.com/jfelchner
72
- [@janraasch]: https://github.com/janraasch
73
- [@jcarbo]: https://github.com/jcarbo
74
- [@oneamtu]: https://github.com/oneamtu
75
- [@toy]: https://github.com/toy
76
- [@Koronen]: https://github.com/Koronen
77
- [@blainesch]: https://github.com/blainesch
78
- [@marxarelli]: https://github.com/marxarelli
79
- [@katieschilling]: https://github.com/katieschilling
80
- [@kakutani]: https://github.com/kakutani
81
- [@rrosenblum]: https://github.com/rrosenblum
82
- [@mattjmcnaughton]: https://github.com/mattjmcnaughton
83
- [@huerlisi]: https://github.com/huerlisi
84
- [@volkert]: https://github.com/volkert
85
- [@lumeet]: https://github.com/lumeet
86
- [@mmozuras]: https://github.com/mmozuras
87
- [@d4rk5eed]: https://github.com/d4rk5eed
88
- [@cshaffer]: https://github.com/cshaffer
89
- [@eitoball]: https://github.com/eitoball
90
- [@iainbeeston]: https://github.com/iainbeeston
91
- [@pimterry]: https://github.com/pimterry
92
- [@palkan]: https://github.com/palkan
93
- [@jdoconnor]: https://github.com/jdoconnor
94
- [@meganemura]: https://github.com/meganemura
95
- [@zvkemp]: https://github.com/zvkemp
96
- [@vassilevsky]: https://github.com/vassilevsky
97
- [@gerry3]: https://github.com/gerry3
98
- [@ypresto]: https://github.com/ypresto
99
- [@clowder]: https://github.com/clowder
100
- [@mudge]: https://github.com/mudge
101
- [@mzp]: https://github.com/mzp
102
- [@bankair]: https://github.com/bankair
103
- [@crimsonknave]: https://github.com/crimsonknave
104
- [@renuo]: https://github.com/renuo
105
- [@sdeframond]: https://github.com/sdeframond
106
- [@til]: https://github.com/til
107
- [@carhartl]: https://github.com/carhartl
108
- [@dylandavidson]: https://github.com/dylandavidson
109
- [@tmr08c]: https://github.com/tmr08c
110
- [@hbd225]: https://github.com/hbd225
111
- [@l8nite]: https://github.com/l8nite
112
- [@sumeet]: https://github.com/sumeet
113
- [@ojab]: https://github.com/ojab
114
- [@chastell]: https://github.com/chastell
115
- [@glasnt]: https://github.com/glasnt
116
- [@crazydog115]: https://github.com/crazydog115
117
- [@RGBD]: https://github.com/RGBD
118
- [@panthomakos]: https://github.com/panthomakos
119
- [@matugm]: https://github.com/matugm
120
- [@m1foley]: https://github.com/m1foley
121
- [@tejasbubane]: https://github.com/tejasbubane
122
- [@bmorrall]: https://github.com/bmorrall
123
- [@fphilipe]: https://github.com/fphilipe
124
- [@gotrevor]: https://github.com/gotrevor
125
- [@awwaiid]: https://github.com/awwaiid
126
- [@segiddins]: https://github.com/segiddins
127
- [@urbanautomaton]: https://github.com/urbanautomaton.com
128
- [@unmanbearpig]: https://github.com/unmanbearpig
129
- [@maxjacobson]: https://github.com/maxjacobson
130
- [@sliuu]: https://github.com/sliuu
131
- [@edmz]: https://github.com/edmz
132
- [@syndbg]: https://github.com/syndbg
133
- [@wli]: https://github.com/wli
134
- [@caseywebdev]: https://github.com/caseywebdev
135
- [@MGerrior]: https://github.com/MGerrior
136
- [@imtayadeway]: https://github.com/imtayadeway
137
- [@mrfoto]: https://github.com/mrfoto
138
- [@karreiro]: https://github.com/karreiro
139
- [@dreyks]: https://github.com/dreyks
@@ -1,210 +0,0 @@
1
- Special thanks to [Alex Dowad](https://github.com/alexdowad) who
2
- contributed an amazing number of bug fixes and improvements for this
3
- release! Much appreciated!
4
-
5
- And happy birthday to my beloved granny Vasilka, who turns today 78 years!
6
- This release is dedicated to her!
7
-
8
- ### New features
9
-
10
- * [#2028](https://github.com/bbatsov/rubocop/issues/2028): New config `ExtraDetails` supports addition of `Details` param to all cops to allow extra details on offense to be displayed. ([@tansaku][])
11
- * [#2036](https://github.com/bbatsov/rubocop/issues/2036): New cop `Style/StabbyLambdaParentheses` will find and correct cases where a stabby lambda's paramaters are not wrapped in parentheses. ([@hmadison][])
12
- * [#2246](https://github.com/bbatsov/rubocop/pull/2246): `Style/TrailingUnderscoreVariable` will now register an offense for `*_`. ([@rrosenblum][])
13
- * [#2246](https://github.com/bbatsov/rubocop/pull/2246): `Style/TrailingUnderscoreVariable` now has a configuration to remove named underscore variables (Defaulted to false). ([@rrosenblum][])
14
- * [#2276](https://github.com/bbatsov/rubocop/pull/2276): New cop `Performance/FixedSize` will register an offense when calling `length`, `size`, or `count` on statically sized objected (strings, symbols, arrays, and hashes). ([@rrosenblum][])
15
- * New cop `Style/NestedModifier` checks for nested `if`, `unless`, `while` and `until` modifier statements. ([@lumeet][])
16
- * [#2270](https://github.com/bbatsov/rubocop/pull/2270): Add a new `inherit_gem` configuration to inherit a config file from an installed gem [(originally requested in #290)](https://github.com/bbatsov/rubocop/issues/290). ([@jhansche][])
17
- * Allow `StyleGuide` parameters in local configuration for all cops, so users can add references to custom style guide documents. ([@cornelius][])
18
- * `UnusedMethodArgument` cop allows configuration to skip keyword arguments. ([@apiology][])
19
- * [#2318](https://github.com/bbatsov/rubocop/pull/2318): `Lint/Debugger` cop now checks for `Pry.rescue`. ([@rrosenblum][])
20
- * [#2277](https://github.com/bbatsov/rubocop/pull/2277): New cop `Style/FirstArrayElementLineBreak` checks for a line break before the first element in a multi-line array. ([@panthomakos][])
21
- * [#2277](https://github.com/bbatsov/rubocop/pull/2277): New cop `Style/FirstHashElementLineBreak` checks for a line break before the first element in a multi-line hash. ([@panthomakos][])
22
- * [#2277](https://github.com/bbatsov/rubocop/pull/2277): New cop `Style/FirstMethodArgumentLineBreak` checks for a line break before the first argument in a multi-line method call. ([@panthomakos][])
23
- * [#2277](https://github.com/bbatsov/rubocop/pull/2277): New cop `Style/FirstMethodParameterLineBreak` checks for a line break before the first parameter in a multi-line method parameter definition. ([@panthomakos][])
24
- * Add `Rails/PluralizationGrammar` cop, checks for incorrect grammar when using methods like `3.day.ago`, when you should write `3.days.ago`. ([@maxjacobson][])
25
- * [#2347](https://github.com/bbatsov/rubocop/pull/2347): `Lint/Eval` cop does not warn about "security risk" when eval argument is a string literal without interpolations. ([@alexdowad][])
26
- * [#2335](https://github.com/bbatsov/rubocop/issues/2335): `Style/VariableName` cop checks naming style of method parameters. ([@alexdowad][])
27
- * [#2329](https://github.com/bbatsov/rubocop/pull/2329): New style `braces_for_chaining` for `Style/BlockDelimiters` cop enforces braces on a multi-line block if its return value is being chained with another method. ([@panthomakos][])
28
- * `Lint/LiteralInCondition` warns if a symbol or dynamic symbol is used as a condition. ([@alexdowad][])
29
- * [#2369](https://github.com/bbatsov/rubocop/issues/2369): `Style/TrailingComma` doesn't add a trailing comma to a multiline method chain which is the only arg to a method call. ([@alexdowad][])
30
- * `CircularArgumentReference` cop updated to lint for ordinal circular argument references on top of optional keyword arguments. ([@maxjacobson][])
31
- * Added ability to download shared rubocop config files from remote urls. ([@ptrippett][])
32
- * [#1601](https://github.com/bbatsov/rubocop/issues/1601): Add `IgnoreEmptyMethods` config parameter for `Lint/UnusedMethodArgument` and `IgnoreEmptyBlocks` config parameter for `Lint/UnusedBlockArgument` cops. ([@alexdowad][])
33
- * [#1729](https://github.com/bbatsov/rubocop/issues/1729): `Style/MethodDefParentheses` supports new 'require_no_parentheses_except_multiline' style. ([@alexdowad][])
34
- * [#2173](https://github.com/bbatsov/rubocop/issues/2173): `Style/AlignParameters` also checks parameter alignment for method definitions. ([@alexdowad][])
35
- * [#1825](https://github.com/bbatsov/rubocop/issues/1825): New `NameWhitelist` configuration parameter for `Style/PredicateName` can be used to suppress errors on known-good predicate names. ([@alexdowad][])
36
- * `Style/Documentation` recognizes 'Constant = Class.new' as a class definition. ([@alexdowad][])
37
- * [#1608](https://github.com/bbatsov/rubocop/issues/1608): Add new 'align_braces' style for `Style/IndentHash`. ([@alexdowad][])
38
- * `Style/Next` can autocorrect. ([@alexdowad][])
39
-
40
- ### Bug Fixes
41
-
42
- * [#2265](https://github.com/bbatsov/rubocop/issues/2265): Handle unary `+` in `ExtraSpacing` cop. ([@jonas054][])
43
- * [#2275](https://github.com/bbatsov/rubocop/pull/2275): Copy default `Exclude` into `Exclude` lists in `.rubocop_todo.yml`. ([@jonas054][])
44
- * `Style/IfUnlessModifier` accepts blocks followed by a chained call. ([@lumeet][])
45
- * [#2261](https://github.com/bbatsov/rubocop/issues/2261): Make relative `Exclude` paths in `$HOME/.rubocop_todo.yml` be relative to current directory. ([@jonas054][])
46
- * [#2286](https://github.com/bbatsov/rubocop/issues/2286): Handle auto-correction of empty method when `AllowIfMethodIsEmpty` is `false` in `Style/SingleLineMethods`. ([@jonas054][])
47
- * [#2246](https://github.com/bbatsov/rubocop/pull/2246): Do not register an offense for `Style/TrailingUnderscoreVariable` when the underscore variable is preceeded by a splat variable. ([@rrosenblum][])
48
- * [#2292](https://github.com/bbatsov/rubocop/pull/2292): Results should not be stored in the cache if affected by errors (crashes). ([@jonas054][])
49
- * [#2280](https://github.com/bbatsov/rubocop/issues/2280): Avoid reporting space between hash literal keys and values in `Style/ExtraSpacing`. ([@jonas054][])
50
- * [#2284](https://github.com/bbatsov/rubocop/issues/2284): Fix result cache being shared between ruby versions. ([@miquella][])
51
- * [#2285](https://github.com/bbatsov/rubocop/issues/2285): Fix `ConfigurableNaming#class_emitter_method?` error when handling singleton class methods. ([@palkan][])
52
- * [#2295](https://github.com/bbatsov/rubocop/issues/2295): Fix Performance/Detect autocorrect to handle rogue newlines. ([@palkan][])
53
- * [#2294](https://github.com/bbatsov/rubocop/issues/2294): Do not register an offense in `Performance/StringReplacement` for regex with options. ([@rrosenblum][])
54
- * Fix `Style/UnneededPercentQ` condition for single-quoted literal containing interpolation-like string. ([@eagletmt][])
55
- * [#2324](https://github.com/bbatsov/rubocop/issues/2324): Handle `--only Lint/Syntax` and `--except Lint/Syntax` correctly. ([@jonas054][])
56
- * [#2317](https://github.com/bbatsov/rubocop/issues/2317): Handle `case` as an argument correctly in `Lint/EndAlignment`. ([@lumeet][])
57
- * [#2287](https://github.com/bbatsov/rubocop/issues/2287): Fix auto-correct of lines with only whitespace in `Style/IndentationWidth`. ([@lumeet][])
58
- * [#2331](https://github.com/bbatsov/rubocop/issues/2331): Do not register an offense in `Performance/Size` for `count` with an argument. ([@rrosenblum][])
59
- * Handle a backslash at the end of a line in `Style/SpaceAroundOperators`. ([@lumeet][])
60
- * Don't warn about lack of "leading space" in a =begin/=end comment. ([@alexdowad][])
61
- * [#2307](https://github.com/bbatsov/rubocop/issues/2307): In `Lint/FormatParameterMismatch`, don't register an offense if either argument to % is not a literal. ([@alexdowad][])
62
- * [#2356](https://github.com/bbatsov/rubocop/pull/2356): `Style/Encoding` will now place the encoding comment on the second line if the first line is a shebang. ([@rrosenblum][])
63
- * `Style/InitialIndentation` cop doesn't error out when a line begins with an integer literal. ([@alexdowad][])
64
- * [#2296](https://github.com/bbatsov/rubocop/issues/2296): In `Style/DotPosition`, don't "correct" (and break) a method call which has a line comment (or blank line) between the dot and the selector. ([@alexdowad][])
65
- * [#2272](https://github.com/bbatsov/rubocop/issues/2272): `Lint/NonLocalExitFromIterator` does not warn about `return` in a block which is passed to `Module#define_method`. ([@alexdowad][])
66
- * [#2262](https://github.com/bbatsov/rubocop/issues/2262): Replace `Rainbow` reference with `Colorizable#yellow`. ([@minustehbare][])
67
- * [#2068](https://github.com/bbatsov/rubocop/issues/2068): Display warning if `Style/Copyright` is misconfigured. ([@alexdowad][])
68
- * [#2321](https://github.com/bbatsov/rubocop/issues/2321): In `Style/EachWithObject`, don't replace reduce with each_with_object if the accumulator parameter is assigned to in the block. ([@alexdowad][])
69
- * [#1981](https://github.com/bbatsov/rubocop/issues/1981): `Lint/UselessAssignment` doesn't erroneously identify assignments in identical if branches as useless. ([@alexdowad][])
70
- * [#2323](https://github.com/bbatsov/rubocop/issues/2323): `Style/IfUnlessModifier` cop parenthesizes autocorrected code when necessary due to operator precedence, to avoid changing its meaning. ([@alexdowad][])
71
- * [#2003](https://github.com/bbatsov/rubocop/issues/2003): Make `Lint/UnneededDisable` work with `--auto-correct`. ([@jonas054][])
72
- * Default RuboCop cache dir moved to per-user folders. ([@br3nda][])
73
- * [#2393](https://github.com/bbatsov/rubocop/pull/2393): `Style/MethodCallParentheses` doesn't fail on `obj.method ||= func()`. ([@alexdowad][])
74
- * [#2344](https://github.com/bbatsov/rubocop/pull/2344): When autocorrecting, `Style/ParallelAssignment` reorders assignment statements, if necessary, to avoid breaking code. ([@alexdowad][])
75
- * `Style/MultilineOperationAlignment` does not try to align the receiver and selector of a method call if both are on the LHS of an assignment. ([@alexdowad][])
76
-
77
- ### Changes
78
-
79
- * [#2194](https://github.com/bbatsov/rubocop/issues/2194): Allow any options with `--auto-gen-config`. ([@agrimm][])
80
-
81
- [@bbatsov]: https://github.com/bbatsov
82
- [@jonas054]: https://github.com/jonas054
83
- [@yujinakayama]: https://github.com/yujinakayama
84
- [@dblock]: https://github.com/dblock
85
- [@nevir]: https://github.com/nevir
86
- [@daviddavis]: https://github.com/daviddavis
87
- [@sds]: https://github.com/sds
88
- [@fancyremarker]: https://github.com/fancyremarker
89
- [@sinisterchipmunk]: https://github.com/sinisterchipmunk
90
- [@vonTronje]: https://github.com/vonTronje
91
- [@agrimm]: https://github.com/agrimm
92
- [@pmenglund]: https://github.com/pmenglund
93
- [@chulkilee]: https://github.com/chulkilee
94
- [@codez]: https://github.com/codez
95
- [@emou]: https://github.com/emou
96
- [@skanev]: http://github.com/skanev
97
- [@claco]: http://github.com/claco
98
- [@rifraf]: http://github.com/rifraf
99
- [@scottmatthewman]: https://github.com/scottmatthewman
100
- [@ma2gedev]: http://github.com/ma2gedev
101
- [@jeremyolliver]: https://github.com/jeremyolliver
102
- [@hannestyden]: https://github.com/hannestyden
103
- [@geniou]: https://github.com/geniou
104
- [@jkogara]: https://github.com/jkogara
105
- [@tmorris-fiksu]: https://github.com/tmorris-fiksu
106
- [@mockdeep]: https://github.com/mockdeep
107
- [@hiroponz]: https://github.com/hiroponz
108
- [@tamird]: https://github.com/tamird
109
- [@fshowalter]: https://github.com/fshowalter
110
- [@cschramm]: https://github.com/cschramm
111
- [@bquorning]: https://github.com/bquorning
112
- [@bcobb]: https://github.com/bcobb
113
- [@irrationalfab]: https://github.com/irrationalfab
114
- [@tommeier]: https://github.com/tommeier
115
- [@sfeldon]: https://github.com/sfeldon
116
- [@biinari]: https://github.com/biinari
117
- [@barunio]: https://github.com/barunio
118
- [@molawson]: https://github.com/molawson
119
- [@wndhydrnt]: https://github.com/wndhydrnt
120
- [@ggilder]: https://github.com/ggilder
121
- [@salbertson]: https://github.com/salbertson
122
- [@camilleldn]: https://github.com/camilleldn
123
- [@mcls]: https://github.com/mcls
124
- [@yous]: https://github.com/yous
125
- [@vrthra]: https://github.com/vrthra
126
- [@SkuliOskarsson]: https://github.com/SkuliOskarsson
127
- [@jspanjers]: https://github.com/jspanjers
128
- [@sch1zo]: https://github.com/sch1zo
129
- [@smangelsdorf]: https://github.com/smangelsdorf
130
- [@mvz]: https://github.com/mvz
131
- [@jfelchner]: https://github.com/jfelchner
132
- [@janraasch]: https://github.com/janraasch
133
- [@jcarbo]: https://github.com/jcarbo
134
- [@oneamtu]: https://github.com/oneamtu
135
- [@toy]: https://github.com/toy
136
- [@Koronen]: https://github.com/Koronen
137
- [@blainesch]: https://github.com/blainesch
138
- [@marxarelli]: https://github.com/marxarelli
139
- [@katieschilling]: https://github.com/katieschilling
140
- [@kakutani]: https://github.com/kakutani
141
- [@rrosenblum]: https://github.com/rrosenblum
142
- [@mattjmcnaughton]: https://github.com/mattjmcnaughton
143
- [@huerlisi]: https://github.com/huerlisi
144
- [@volkert]: https://github.com/volkert
145
- [@lumeet]: https://github.com/lumeet
146
- [@mmozuras]: https://github.com/mmozuras
147
- [@d4rk5eed]: https://github.com/d4rk5eed
148
- [@cshaffer]: https://github.com/cshaffer
149
- [@eitoball]: https://github.com/eitoball
150
- [@iainbeeston]: https://github.com/iainbeeston
151
- [@pimterry]: https://github.com/pimterry
152
- [@palkan]: https://github.com/palkan
153
- [@jdoconnor]: https://github.com/jdoconnor
154
- [@meganemura]: https://github.com/meganemura
155
- [@zvkemp]: https://github.com/zvkemp
156
- [@vassilevsky]: https://github.com/vassilevsky
157
- [@gerry3]: https://github.com/gerry3
158
- [@ypresto]: https://github.com/ypresto
159
- [@clowder]: https://github.com/clowder
160
- [@mudge]: https://github.com/mudge
161
- [@mzp]: https://github.com/mzp
162
- [@bankair]: https://github.com/bankair
163
- [@crimsonknave]: https://github.com/crimsonknave
164
- [@renuo]: https://github.com/renuo
165
- [@sdeframond]: https://github.com/sdeframond
166
- [@til]: https://github.com/til
167
- [@carhartl]: https://github.com/carhartl
168
- [@dylandavidson]: https://github.com/dylandavidson
169
- [@tmr08c]: https://github.com/tmr08c
170
- [@hbd225]: https://github.com/hbd225
171
- [@l8nite]: https://github.com/l8nite
172
- [@sumeet]: https://github.com/sumeet
173
- [@ojab]: https://github.com/ojab
174
- [@chastell]: https://github.com/chastell
175
- [@glasnt]: https://github.com/glasnt
176
- [@crazydog115]: https://github.com/crazydog115
177
- [@RGBD]: https://github.com/RGBD
178
- [@panthomakos]: https://github.com/panthomakos
179
- [@matugm]: https://github.com/matugm
180
- [@m1foley]: https://github.com/m1foley
181
- [@tejasbubane]: https://github.com/tejasbubane
182
- [@bmorrall]: https://github.com/bmorrall
183
- [@fphilipe]: https://github.com/fphilipe
184
- [@gotrevor]: https://github.com/gotrevor
185
- [@awwaiid]: https://github.com/awwaiid
186
- [@segiddins]: https://github.com/segiddins
187
- [@urbanautomaton]: https://github.com/urbanautomaton.com
188
- [@unmanbearpig]: https://github.com/unmanbearpig
189
- [@maxjacobson]: https://github.com/maxjacobson
190
- [@sliuu]: https://github.com/sliuu
191
- [@edmz]: https://github.com/edmz
192
- [@syndbg]: https://github.com/syndbg
193
- [@wli]: https://github.com/wli
194
- [@caseywebdev]: https://github.com/caseywebdev
195
- [@MGerrior]: https://github.com/MGerrior
196
- [@imtayadeway]: https://github.com/imtayadeway
197
- [@mrfoto]: https://github.com/mrfoto
198
- [@karreiro]: https://github.com/karreiro
199
- [@dreyks]: https://github.com/dreyks
200
- [@hmadison]: https://github.com/hmadison
201
- [@miquella]: https://github.com/miquella
202
- [@jhansche]: https://github.com/jhansche
203
- [@cornelius]: https://github.com/cornelius
204
- [@eagletmt]: https://github.com/eagletmt
205
- [@apiology]: https://github.com/apiology
206
- [@alexdowad]: https://github.com/alexdowad
207
- [@minustehbare]: https://github.com/minustehbare
208
- [@tansaku]: https://github.com/tansaku
209
- [@ptrippett]: https://github.com/ptrippett
210
- [@br3nda]: https://github.com/br3nda
@@ -1,307 +0,0 @@
1
- An epic release - the one which contains the most new features and
2
- bugfixes since the inception of the project! A huge thanks to the
3
- amazing contributors who helped make it a reality!
4
-
5
- Notably, this release adds support for Ruby 2.3 and introduces the
6
- important concept of a target Ruby version - meaning RuboCop will no
7
- longer try to parse the code with a parser matching the interpreter
8
- you're using, but a parser matching the target Ruby version you
9
- specified in `.rubocop.yml`. This way you won't introduce accidentally
10
- syntax from a newer Ruby when you want to maintain
11
- compatibility with certain older Rubies.
12
-
13
- Enjoy!
14
-
15
- ### New features
16
-
17
- * [#2598](https://github.com/bbatsov/rubocop/pull/2598): New cop `Lint/RandOne` checks for `rand(1)`, `Kernel.rand(1.0)` and similar calls. Such call are most likely a mistake because they always return `0`. ([@DNNX][])
18
- * [#2590](https://github.com/bbatsov/rubocop/pull/2590): New cop `Performance/DoubleStartEndWith` checks for two `start_with?` (or `end_with?`) calls joined by `||` with the same receiver, like `str.start_with?('x') || str.start_with?('y')` and suggests using one call instead: `str.start_with?('x', 'y')`. ([@DNNX][])
19
- * [#2583](https://github.com/bbatsov/rubocop/pull/2583): New cop `Performance/TimesMap` checks for `x.times.map{}` and suggests replacing them with `Array.new(x){}`. ([@DNNX][])
20
- * [#2581](https://github.com/bbatsov/rubocop/pull/2581): New cop `Lint/NextWithoutAccumulator` finds bare `next` in `reduce`/`inject` blocks which assigns `nil` to the accumulator. ([@mvidner][])
21
- * [#2529](https://github.com/bbatsov/rubocop/pull/2529): Add EnforcedStyle config parameter to IndentArray. ([@jawshooah][])
22
- * [#2479](https://github.com/bbatsov/rubocop/pull/2479): Add option `AllowHeredoc` to `Metrics/LineLength`. ([@fphilipe][])
23
- * [#2416](https://github.com/bbatsov/rubocop/pull/2416): New cop `Style/ConditionalAssignment` checks for assignment of the same variable in all branches of conditionals and replaces them with a single assignment to the return of the conditional. ([@rrosenblum][])
24
- * [#2410](https://github.com/bbatsov/rubocop/pull/2410): New cop `Style/IndentAssignment` checks the indentation of the first line of the right-hand-side of a multi-line assignment. ([@panthomakos][])
25
- * [#2431](https://github.com/bbatsov/rubocop/issues/2431): Add `IgnoreExecutableScripts` option to `Style/FileName`. ([@sometimesfood][])
26
- * [#2460](https://github.com/bbatsov/rubocop/pull/2460): New cop `Style/UnneededInterpolation` checks for strings that are just an interpolated expression. ([@cgriego][])
27
- * [#2361](https://github.com/bbatsov/rubocop/pull/2361): `Style/MultilineAssignmentLayout` cop checks for a newline after the assignment operator in a multi-line assignment. ([@panthomakos][])
28
- * [#2462](https://github.com/bbatsov/rubocop/issues/2462): `Lint/UselessAccessModifier` can catch more types of useless access modifiers. ([@alexdowad][])
29
- * [#1677](https://github.com/bbatsov/rubocop/issues/1677): Add new `Performance/Casecmp` cop. ([@alexdowad][])
30
- * [#1677](https://github.com/bbatsov/rubocop/issues/1677): Add new `Performance/RangeInclude` cop. ([@alexdowad][])
31
- * [#1677](https://github.com/bbatsov/rubocop/issues/1677): Add new `Performance/RedundantSortBy` cop. ([@alexdowad][])
32
- * [#1677](https://github.com/bbatsov/rubocop/issues/1677): Add new `Performance/LstripRstrip` cop. ([@alexdowad][])
33
- * [#1677](https://github.com/bbatsov/rubocop/issues/1677): Add new `Performance/StartWith` cop. ([@alexdowad][])
34
- * [#1677](https://github.com/bbatsov/rubocop/issues/1677): Add new `Performance/EndWith` cop. ([@alexdowad][])
35
- * [#1677](https://github.com/bbatsov/rubocop/issues/1677): Add new `Performance/RedundantMerge` cop. ([@alexdowad][])
36
- * `Lint/Debugger` cop can now auto-correct offenses. ([@alexdowad][])
37
- * [#1677](https://github.com/bbatsov/rubocop/issues/1677): Add new `Performance/RedundantMatch` cop. ([@alexdowad][])
38
- * [#1677](https://github.com/bbatsov/rubocop/issues/1677): Add new `Performance/RedundantBlockCall` cop. ([@alexdowad][])
39
- * [#1954](https://github.com/bbatsov/rubocop/issues/1954): `Lint/UnneededDisable` can now autocorrect. ([@alexdowad][])
40
- * [#2501](https://github.com/bbatsov/rubocop/issues/2501): Add new `Lint/ImplicitStringConcatenation` cop. ([@alexdowad][])
41
- * Add new `Style/RedundantParentheses` cop. ([@lumeet][])
42
- * [#1346](https://github.com/bbatsov/rubocop/issues/1346): `Style/SpecialGlobalVars` can be configured to use either `use_english_names` or `use_perl_names` styles. ([@alexdowad][])
43
- * [#2426](https://github.com/bbatsov/rubocop/issues/2426): New `Style/NestedParenthesizedCalls` cop checks for non-parenthesized method calls nested inside a parenthesized call, like `method1(method2 arg)`. ([@alexdowad][])
44
- * [#2502](https://github.com/bbatsov/rubocop/issues/2502): The `--stdin` and `--auto-correct` CLI options can be combined, and if you do so, corrected code is printed to stdout. ([@alexdowad][])
45
- * `Style/ConditionalAssignment` works on conditionals with a common aref assignment (like `array[index] = val`) or attribute assignment (like `self.attribute = val`). ([@alexdowad][])
46
- * [#2476](https://github.com/bbatsov/rubocop/issues/2476): `Style/GuardClause` catches if..else nodes with one branch which terminates the execution of the current scope. ([@alexdowad][])
47
- * New `Style/IdenticalConditionalBranches` flags `if..else` and `case..when..else` constructs with an identical line at the end of each branch. ([@alexdowad][])
48
- * [#207](https://github.com/bbatsov/rubocop/issues/207): Add new `Lint/FloatOutOfRange` cop which catches floating-point literals which are too large or too small for Ruby to represent. ([@alexdowad][])
49
- * `Style/GuardClause` doesn't report offenses in places where correction would make a line too long. ([@alexdowad][])
50
- * `Lint/DuplicateMethods` can find duplicate method definitions in many more circumstances, even across multiple files; however, it ignores definitions inside `if` or something which could be a DSL method. ([@alexdowad][])
51
- * A warning is printed if an invalid `EnforcedStyle` is configured. ([@alexdowad][])
52
- * [#1367](https://github.com/bbatsov/rubocop/issues/1367): New `Lint/IneffectiveAccessModifier` checks for access modifiers which are erroneously applied to a singleton method, where they have no effect. ([@alexdowad][])
53
- * [#1614](https://github.com/bbatsov/rubocop/issues/1614): `Lint/BlockAlignment` aligns block end with splat operator when applied to a splatted method call. ([@alexdowad][])
54
- * [#2263](https://github.com/bbatsov/rubocop/issues/2263): Warn if `task.options = %w(--format ...)` is used when configuring `RuboCop::RakeTask`; this should be `task.formatters = ...` instead. ([@alexdowad][])
55
- * [#2511](https://github.com/bbatsov/rubocop/issues/2511): `--no-offense-counts` CLI option suppresses the inclusion of offense count lines in auto-generated config. ([@alexdowad][])
56
- * [#2504](https://github.com/bbatsov/rubocop/issues/2504): New `AllowForAlignment` config parameter for `Style/SingleSpaceBeforeFirstArg` allows the insertion of extra spaces before the first argument if it aligns it with something on the preceding or following line. ([@alexdowad][])
57
- * [#2478](https://github.com/bbatsov/rubocop/issues/2478): `Style/ExtraSpacing` has new `ForceEqualSignAlignment` config parameter which forces = signs on consecutive lines to be aligned, and it can auto-correct. ([@alexdowad][])
58
- * `Lint/BlockAlignment` aligns block end with unary operators like ~, -, or ! when such operators are applied to the method call taking the block. ([@alexdowad][])
59
- * [#1460](https://github.com/bbatsov/rubocop/issues/1460): `Style/Alias` supports both `prefer_alias` and `prefer_alias_method` styles. ([@alexdowad][])
60
- * [#1569](https://github.com/bbatsov/rubocop/issues/1569): New `ExpectMatchingDefinition` config parameter for `Style/FileName` makes it check for a class or module definition in each file which corresponds to the file name and path. ([@alexdowad][])
61
- * [#2480](https://github.com/bbatsov/rubocop/pull/2480): Add a configuration to `Style/ConditionalAssignment` to check and correct conditionals that contain multiple assignments. ([@rrosenblum][])
62
- * [#2480](https://github.com/bbatsov/rubocop/pull/2480): Allow `Style/ConditionalAssignment` to correct assignment in ternary operations. ([@rrosenblum][])
63
- * [#2480](https://github.com/bbatsov/rubocop/pull/2480): Allow `Style/ConditionalAssignment` to correct comparable methods. ([@rrosenblum][])
64
- * [#1633](https://github.com/bbatsov/rubocop/issues/1633): New cop `Style/MultilineMethodCallIndentation` takes over the responsibility for checking alignment of methods from the `Style/MultilineOperationIndentation` cop. ([@jonas054][])
65
- * [#2472](https://github.com/bbatsov/rubocop/pull/2472): New cop `Style/MultilineArrayBraceLayout` checks that the closing brace in an array literal is symmetrical with respect to the opening brace and the array elements. ([@panthomakos][])
66
- * [#1543](https://github.com/bbatsov/rubocop/issues/1543): `Style/WordArray` has both `percent` and `brackets` (which enforces the use of bracketed arrays for strings) styles. ([@alexdowad][])
67
- * `Style/SpaceAroundOperators` has `AllowForAlignment` config parameter which allows extra spaces on the left if they serve to align the operator with another. ([@alexdowad][])
68
- * `Style/SymbolArray` has both `percent` and `brackets` (which enforces the user of bracketed arrays for symbols) styles. ([@alexdowad][])
69
- * [#2343](https://github.com/bbatsov/rubocop/issues/2343): Entire cop types (or "departments") can be disabled using in .rubocop.yml using config like `Style: Enabled: false`. ([@alexdowad][])
70
- * [#2399](https://github.com/bbatsov/rubocop/issues/2399): New `start_of_line` style for `Lint/EndAlignment` aligns a closing `end` keyword with the start of the line where the opening keyword appears. ([@alexdowad][])
71
- * [#1545](https://github.com/bbatsov/rubocop/issues/1545): New `Regex` config parameter for `Style/FileName` allows user to provide their own regex for validating file names. ([@alexdowad][])
72
- * [#2253](https://github.com/bbatsov/rubocop/issues/2253): New `DefaultFormatter` config parameter can be used to set formatter from within .rubocop.yml. ([@alexdowad][])
73
- * [#2481](https://github.com/bbatsov/rubocop/issues/2481): New `WorstOffendersFormatter` prints a list of files with offenses (and offense counts), showing the files with the most offenses first. ([@alexdowad][])
74
- * New `IfInsideElse` cop catches `if..end` nodes which can be converted into an `elsif` instead, reducing the nesting level. ([@alexdowad][])
75
- * [#1725](https://github.com/bbatsov/rubocop/issues/1725): --color CLI option forces color output, even when not printing to a TTY. ([@alexdowad][])
76
- * [#2549](https://github.com/bbatsov/rubocop/issues/2549): New `ConsistentQuotesInMultiline` config param for `Style/StringLiterals` forces all literals which are concatenated using \ to use the same quote style. ([@alexdowad][])
77
- * [#2560](https://github.com/bbatsov/rubocop/issues/2560): `Style/AccessModifierIndentation`, `Style/CaseIndentation`, `Style/FirstParameterIndentation`, `Style/IndentArray`, `Style/IndentAssignment`, `Style/IndentHash`, `Style/MultilineMethodCallIndentation`, and `Style/MultilineOperationIndentation` all have a new `IndentationWidth` parameter which can be used to override the indentation width from `Style/IndentationWidth`. ([@alexdowad][])
78
- * Add new `Performance/HashEachMethods` cop. ([@ojab][])
79
- * New cop `Style/FrozenStringLiteralComment` will check for and add the comment `# frozen_string_literal: true` to the top of files. This will help with upgrading to Ruby 3.0. ([@rrosenblum][])
80
-
81
- ### Bug Fixes
82
-
83
- * [#2594](https://github.com/bbatsov/rubocop/issues/2594): `Style/EmptyLiteral` autocorrector respects `Style/StringLiterals:EnforcedStyle` config. ([@DNNX][])
84
- * [#2411](https://github.com/bbatsov/rubocop/issues/2411): Make local inherited configuration override configuration loaded from gems. ([@jonas054][])
85
- * [#2413](https://github.com/bbatsov/rubocop/issues/2413): Allow `%Q` for dynamic strings with double quotes inside them. ([@jonas054][])
86
- * [#2404](https://github.com/bbatsov/rubocop/issues/2404): `Style/Next` does not remove comments when auto-correcting. ([@lumeet][])
87
- * `Style/Next` handles auto-correction of nested offenses. ([@lumeet][])
88
- * `Style/VariableInterpolation` now detects non-numeric regex back references. ([@cgriego][])
89
- * `ProgressFormatter` fully respects the `--no-color` switch. ([@savef][])
90
- * Replace `Time.zone.current` with `Time.current` on `Rails::TimeZone` cop message. ([@volmer][])
91
- * [#2451](https://github.com/bbatsov/rubocop/issues/2451): `Style/StabbyLambdaParentheses` does not treat method calls named `lambda` as lambdas. ([@domcleal][])
92
- * [#2463](https://github.com/bbatsov/rubocop/issues/2463): Allow comments before an access modifier. ([@codebeige][])
93
- * [#2471](https://github.com/bbatsov/rubocop/issues/2471): `Style/MethodName` doesn't choke on methods which are defined inside methods. ([@alexdowad][])
94
- * [#2449](https://github.com/bbatsov/rubocop/issues/2449): `Style/StabbyLambdaParentheses` only checks lambdas in the arrow form. ([@lumeet][])
95
- * [#2456](https://github.com/bbatsov/rubocop/issues/2456): `Lint/NestedMethodDefinition` doesn't register offenses for method definitions inside an eval block (either `instance_eval`, `class_eval`, or `module_eval`). ([@alexdowad][])
96
- * [#2464](https://github.com/bbatsov/rubocop/issues/2464): `Style/ParallelAssignment` understands aref and attribute assignments, and doesn't warn if they can't be correctly rearranged into a series of single assignments. ([@alexdowad][])
97
- * [#2482](https://github.com/bbatsov/rubocop/issues/2482): `Style/AndOr` doesn't raise an exception when trying to autocorrect `!variable or ...`. ([@alexdowad][])
98
- * [#2446](https://github.com/bbatsov/rubocop/issues/2446): `Style/Tab` doesn't register errors for leading tabs which occur inside a string literal (including heredoc). ([@alexdowad][])
99
- * [#2452](https://github.com/bbatsov/rubocop/issues/2452): `Style/TrailingComma` incorrectly categorizes single-line hashes in methods calls. ([@panthomakos][])
100
- * [#2441](https://github.com/bbatsov/rubocop/issues/2441): `Style/AlignParameters` doesn't crash if it finds nested offenses. ([@alexdowad][])
101
- * [#2436](https://github.com/bbatsov/rubocop/issues/2436): `Style/SpaceInsideHashLiteralBraces` doesn't mangle a hash literal which is not surrounded by curly braces, but has another hash literal which does as its first key. ([@alexdowad][])
102
- * [#2483](https://github.com/bbatsov/rubocop/issues/2483): `Style/Attr` differentiate between attr_accessor and attr_reader. ([@weh][])
103
- * `Style/ConditionalAssignment` doesn't crash if it finds a `case` with an empty branch. ([@lumeet][])
104
- * [#2506](https://github.com/bbatsov/rubocop/issues/2506): `Lint/FormatParameterMismatch` understands %{} and %<> interpolations. ([@alexdowad][])
105
- * [#2145](https://github.com/bbatsov/rubocop/issues/2145): `Lint/ParenthesesAsGroupedExpression` ignores calls with multiple arguments, since they are not ambiguous. ([@alexdowad][])
106
- * [#2484](https://github.com/bbatsov/rubocop/issues/2484): Remove two vulnerabilities in cache handling. ([@jonas054][])
107
- * [#2517](https://github.com/bbatsov/rubocop/issues/2517): `Lint/UselessAccessModifier` doesn't think that an access modifier applied to `attr_writer` is useless. ([@alexdowad][])
108
- * [#2518](https://github.com/bbatsov/rubocop/issues/2518): `Style/ConditionalAssignment` doesn't think that branches using `<<` and `[]=` should be combined. ([@alexdowad][])
109
- * `CharacterLiteral` auto-corrector now properly corrects `?'`. ([@bfontaine][])
110
- * [#2313](https://github.com/bbatsov/rubocop/issues/2313): `Rails/FindEach` doesn't break code which uses `order(...).each`, `limit(...).each`, and so on. ([@alexdowad][])
111
- * [#1938](https://github.com/bbatsov/rubocop/issues/1938): `Rails/FindBy` doesn't autocorrect `where(...).first` to `find_by`, since the returned record is often different. ([@alexdowad][])
112
- * [#1801](https://github.com/bbatsov/rubocop/issues/1801): `EmacsFormatter` strips newlines out of error messages, if there are any. ([@alexdowad][])
113
- * [#2534](https://github.com/bbatsov/rubocop/issues/2534): `Style/RescueEnsureAlignment` works on `rescue` nested inside a `class` or `module` block. ([@alexdowad][])
114
- * `Lint/BlockAlignment` does not refer to a block terminator as `end` when it is actually `}`. ([@alexdowad][])
115
- * [#2540](https://github.com/bbatsov/rubocop/issues/2540): `Lint/FormatParameterMismatch` understands format specifiers with multiple flags. ([@alexdowad][])
116
- * [#2538](https://github.com/bbatsov/rubocop/issues/2538): `Style/SpaceAroundOperators` doesn't eat newlines. ([@alexdowad][])
117
- * [#2531](https://github.com/bbatsov/rubocop/issues/2531): `Style/AndOr` autocorrects in cases where parentheses must be added, even inside a nested begin node. ([@alexdowad][])
118
- * [#2450](https://github.com/bbatsov/rubocop/issues/2450): `Style/Next` adjusts indentation when auto-correcting, to avoid introducing new offenses. ([@alexdowad][])
119
- * [#2066](https://github.com/bbatsov/rubocop/issues/2066): `Style/TrivialAccessors` doesn't flag what appear to be trivial accessor method definitions, if they are nested inside a call to `instance_eval`. ([@alexdowad][])
120
- * `Style/SymbolArray` doesn't flag arrays of symbols if a symbol contains a space character. ([@alexdowad][])
121
- * `Style/SymbolArray` can auto-correct offenses. ([@alexdowad][])
122
- * [#2546](https://github.com/bbatsov/rubocop/issues/2546): Report when two `rubocop:disable` comments (not the single line kind) for a given cop apppear in a file with no `rubocop:enable` in between. ([@jonas054][])
123
- * [#2552](https://github.com/bbatsov/rubocop/issues/2552): `Style/Encoding` can auto-correct files with a blank first line. ([@alexdowad][])
124
- * [#2556](https://github.com/bbatsov/rubocop/issues/2556): `Style/SpecialGlobalVariables` generates auto-config correctly. ([@alexdowad][])
125
- * [#2565](https://github.com/bbatsov/rubocop/issues/2565): Let `Style/SpaceAroundOperators` leave spacing around `=>` to `Style/AlignHash`. ([@jonas054][])
126
- * [#2569](https://github.com/bbatsov/rubocop/issues/2569): `Style/MethodCallParentheses` doesn't register warnings for `object.()` syntax, since it is handled by `Style/LambdaCall`. ([@alexdowad][])
127
- * [#2570](https://github.com/bbatsov/rubocop/issues/2570): `Performance/RedundantMerge` doesn't break code with a modifier `if` when autocorrecting. ([@alexdowad][])
128
- * `Performance/RedundantMerge` doesn't break code with a modifier `while` or `until` when autocorrecting. ([@alexdowad][])
129
- * [#2574](https://github.com/bbatsov/rubocop/issues/2574): `variable` style for `Lint/EndAlignment` is working again. ([@alexdowad][])
130
- * `Lint/EndAlignment` can autocorrect offenses on the RHS of an assignment to an instance variable, class variable, constant, and so on; previously, it only worked if the LHS was a local variable. ([@alexdowad][])
131
- * [#2580](https://github.com/bbatsov/rubocop/issues/2580): `Style/StringReplacement` doesn't break code when autocorrection involves a regex with embedded escapes (like /\n/). ([@alexdowad][])
132
- * [#2582](https://github.com/bbatsov/rubocop/issues/2582): `Style/AlignHash` doesn't move a key so far left that it goes onto the previous line (in an attempt to align). ([@alexdowad][])
133
- * [#2588](https://github.com/bbatsov/rubocop/issues/2588): `Style/SymbolProc` doesn't break code when autocorrecting a method call with a trailing comma in the argument list. ([@alexdowad][])
134
- * [#2448](https://github.com/bbatsov/rubocop/issues/2448): `Style/TrailingCommaInArguments` and `Style/TrailingCommaInLiteral` don't special-case single-item lists in a way which contradicts the documentation. ([@alexdowad][])
135
- * Fix for remote config files to only load from on http and https URLs. ([@ptrippett][])
136
- * [#2604](https://github.com/bbatsov/rubocop/issues/2604): `Style/FileName` doesn't fail on empty files when `ExpectMatchingDefinition` is true. ([@alexdowad][])
137
- * `Style/RedundantFreeze` registers offences for frozen dynamic symbols. ([@segiddins][])
138
- * [#2609](https://github.com/bbatsov/rubocop/issues/2609): All cops which rely on the `AutocorrectUnlessChangingAST` module can now autocorrect files which contain `__FILE__`. ([@alexdowad][])
139
- * [#2608](https://github.com/bbatsov/rubocop/issues/2608): `Style/ConditionalAssignment` can autocorrect `=~` within a ternary expression. ([@alexdowad][])
140
-
141
- ### Changes
142
-
143
- * [#2427](https://github.com/bbatsov/rubocop/pull/2427): Allow non-snake-case file names (e.g. `some-random-script`) for Ruby scripts that have a shebang. ([@sometimesfood][])
144
- * [#2430](https://github.com/bbatsov/rubocop/pull/2430): `Lint/UnneededDisable` now adds "unknown cop" to messages if cop names in `rubocop:disable` comments are unrecognized, or "did you mean ..." if they are misspelled names of existing cops. ([@jonas054][])
145
- * [#947](https://github.com/bbatsov/rubocop/issues/947): `Style/Documentation` considers classes and modules which only define constants to be "namespaces", and doesn't flag them for lack of a documentation comment. ([@alexdowad][])
146
- * [#2467](https://github.com/bbatsov/rubocop/issues/2467): Explicitly inheriting configuration from the rubocop gem in .rubocop.yml is not allowed. ([@alexdowad][])
147
- * [#2322](https://github.com/bbatsov/rubocop/issues/2322): Output of --auto-gen-config shows content of default config parameters which are Arrays; this is especially useful for SupportedStyles. ([@alexdowad][])
148
- * [#1566](https://github.com/bbatsov/rubocop/issues/1566): When autocorrecting on Windows, line endings are not converted to "\r\n" in untouched portions of the source files; corrected portions may use "\n" rather than "\r\n". ([@alexdowad][])
149
- * New `rake repl` task can be used for experimentation when working on RuboCop. ([@alexdowad][])
150
- * `Lint/SpaceBeforeFirstArg` cop has been removed, since it just duplicates `Style/SingleSpaceBeforeFirstArg`. ([@alexdowad][])
151
- * `Style/SingleSpaceBeforeFirstArg` cop has been renamed to `Style/SpaceBeforeFirstArg`, which more accurately reflects what it now does. ([@alexdowad][])
152
- * `Style/UnneededPercentQ` reports `%q()` strings with what only appears to be an escape, but is not really (there are no escapes in `%q()` strings). ([@alexdowad][])
153
- * `Performance/StringReplacement`, `Performance\StartWith`, and `Performance\EndWith` more accurately identify code which can be improved. ([@alexdowad][])
154
- * The `MultiSpaceAllowedForOperators` config parameter for `Style/SpaceAroundOperators` has been removed, as it is made redundant by `AllowForAlignment`. If someone attempts to use it, config validation will fail with a helpful message. ([@alexdowad][])
155
- * The `RunRailsCops` config parameter in .rubocop.yml is now obsolete. If someone attempts to use it, config validation will fail with a helpful message. ([@alexdowad][])
156
- * If .rubocop.yml contains configuration for a custom cop, no warning regarding "unknown cop" will be printed. The custom cop must inherit from RuboCop::Cop::Cop, and must be loaded into memory for this to work. ([@alexdowad][])
157
- * [#2102](https://github.com/bbatsov/rubocop/issues/2102): If .rubocop.yml exists in the working directory when running --auto-gen-config, any `Exclude` config parameters in .rubocop.yml will be merged into the generated .rubocop_todo.yml. ([@alexdowad][])
158
- * [#1895](https://github.com/bbatsov/rubocop/issues/1895): Remove `Rails/DefaultScope` cop. ([@alexdowad][])
159
- * [#2550](https://github.com/bbatsov/rubocop/issues/2550): New `TargetRubyVersion` configuration parameter can be used to specify which version of the Ruby interpreter the inspected code is intended to run on. ([@alexdowad][])
160
- * [#2557](https://github.com/bbatsov/rubocop/issues/2557): `Style/GuardClause` does not warn about `if` nodes whose condition spans multiple lines. ([@alexdowad][])
161
- * `Style/EmptyLinesAroundClassBody`, `Style/EmptyLinesAroundModuleBody`, and `Style/EmptyLinesAroundBlockBody` accept an empty body with no blank line, even if configured to `empty_lines` style. This is because the empty lines only serve to provide a break between the header, body, and footer, and are redundant if there is no body. ([@alexdowad][])
162
- * [#2554](https://github.com/bbatsov/rubocop/issues/2554): `Style/FirstMethodArgumentLineBreak` handles implicit hash arguments without braces; `Style/FirstHashElementLineBreak` still handles those with braces. ([@alexdowad][])
163
- * `Style/TrailingComma` has been split into `Style/TrailingCommaInArguments` and `Style/TrailingCommaInLiteral`. ([@alexdowad][])
164
- * RuboCop returns process exit code 2 if it fails due to bad configuration, bad CLI options, or an internal error. If it runs successfully but finds one or more offenses, it still exits with code 1, as was previously the case. This is helpful when invoking RuboCop programmatically, perhaps from a script. ([@alexdowad][])
165
-
166
- [@bbatsov]: https://github.com/bbatsov
167
- [@jonas054]: https://github.com/jonas054
168
- [@yujinakayama]: https://github.com/yujinakayama
169
- [@dblock]: https://github.com/dblock
170
- [@nevir]: https://github.com/nevir
171
- [@daviddavis]: https://github.com/daviddavis
172
- [@sds]: https://github.com/sds
173
- [@fancyremarker]: https://github.com/fancyremarker
174
- [@sinisterchipmunk]: https://github.com/sinisterchipmunk
175
- [@vonTronje]: https://github.com/vonTronje
176
- [@agrimm]: https://github.com/agrimm
177
- [@pmenglund]: https://github.com/pmenglund
178
- [@chulkilee]: https://github.com/chulkilee
179
- [@codez]: https://github.com/codez
180
- [@emou]: https://github.com/emou
181
- [@skanev]: http://github.com/skanev
182
- [@claco]: http://github.com/claco
183
- [@rifraf]: http://github.com/rifraf
184
- [@scottmatthewman]: https://github.com/scottmatthewman
185
- [@ma2gedev]: http://github.com/ma2gedev
186
- [@jeremyolliver]: https://github.com/jeremyolliver
187
- [@hannestyden]: https://github.com/hannestyden
188
- [@geniou]: https://github.com/geniou
189
- [@jkogara]: https://github.com/jkogara
190
- [@tmorris-fiksu]: https://github.com/tmorris-fiksu
191
- [@mockdeep]: https://github.com/mockdeep
192
- [@hiroponz]: https://github.com/hiroponz
193
- [@tamird]: https://github.com/tamird
194
- [@fshowalter]: https://github.com/fshowalter
195
- [@cschramm]: https://github.com/cschramm
196
- [@bquorning]: https://github.com/bquorning
197
- [@bcobb]: https://github.com/bcobb
198
- [@irrationalfab]: https://github.com/irrationalfab
199
- [@tommeier]: https://github.com/tommeier
200
- [@sfeldon]: https://github.com/sfeldon
201
- [@biinari]: https://github.com/biinari
202
- [@barunio]: https://github.com/barunio
203
- [@molawson]: https://github.com/molawson
204
- [@wndhydrnt]: https://github.com/wndhydrnt
205
- [@ggilder]: https://github.com/ggilder
206
- [@salbertson]: https://github.com/salbertson
207
- [@camilleldn]: https://github.com/camilleldn
208
- [@mcls]: https://github.com/mcls
209
- [@yous]: https://github.com/yous
210
- [@vrthra]: https://github.com/vrthra
211
- [@SkuliOskarsson]: https://github.com/SkuliOskarsson
212
- [@jspanjers]: https://github.com/jspanjers
213
- [@sch1zo]: https://github.com/sch1zo
214
- [@smangelsdorf]: https://github.com/smangelsdorf
215
- [@mvz]: https://github.com/mvz
216
- [@jfelchner]: https://github.com/jfelchner
217
- [@janraasch]: https://github.com/janraasch
218
- [@jcarbo]: https://github.com/jcarbo
219
- [@oneamtu]: https://github.com/oneamtu
220
- [@toy]: https://github.com/toy
221
- [@Koronen]: https://github.com/Koronen
222
- [@blainesch]: https://github.com/blainesch
223
- [@marxarelli]: https://github.com/marxarelli
224
- [@katieschilling]: https://github.com/katieschilling
225
- [@kakutani]: https://github.com/kakutani
226
- [@rrosenblum]: https://github.com/rrosenblum
227
- [@mattjmcnaughton]: https://github.com/mattjmcnaughton
228
- [@huerlisi]: https://github.com/huerlisi
229
- [@volkert]: https://github.com/volkert
230
- [@lumeet]: https://github.com/lumeet
231
- [@mmozuras]: https://github.com/mmozuras
232
- [@d4rk5eed]: https://github.com/d4rk5eed
233
- [@cshaffer]: https://github.com/cshaffer
234
- [@eitoball]: https://github.com/eitoball
235
- [@iainbeeston]: https://github.com/iainbeeston
236
- [@pimterry]: https://github.com/pimterry
237
- [@palkan]: https://github.com/palkan
238
- [@jdoconnor]: https://github.com/jdoconnor
239
- [@meganemura]: https://github.com/meganemura
240
- [@zvkemp]: https://github.com/zvkemp
241
- [@vassilevsky]: https://github.com/vassilevsky
242
- [@gerry3]: https://github.com/gerry3
243
- [@ypresto]: https://github.com/ypresto
244
- [@clowder]: https://github.com/clowder
245
- [@mudge]: https://github.com/mudge
246
- [@mzp]: https://github.com/mzp
247
- [@bankair]: https://github.com/bankair
248
- [@crimsonknave]: https://github.com/crimsonknave
249
- [@renuo]: https://github.com/renuo
250
- [@sdeframond]: https://github.com/sdeframond
251
- [@til]: https://github.com/til
252
- [@carhartl]: https://github.com/carhartl
253
- [@dylandavidson]: https://github.com/dylandavidson
254
- [@tmr08c]: https://github.com/tmr08c
255
- [@hbd225]: https://github.com/hbd225
256
- [@l8nite]: https://github.com/l8nite
257
- [@sumeet]: https://github.com/sumeet
258
- [@ojab]: https://github.com/ojab
259
- [@chastell]: https://github.com/chastell
260
- [@glasnt]: https://github.com/glasnt
261
- [@crazydog115]: https://github.com/crazydog115
262
- [@RGBD]: https://github.com/RGBD
263
- [@panthomakos]: https://github.com/panthomakos
264
- [@matugm]: https://github.com/matugm
265
- [@m1foley]: https://github.com/m1foley
266
- [@tejasbubane]: https://github.com/tejasbubane
267
- [@bmorrall]: https://github.com/bmorrall
268
- [@fphilipe]: https://github.com/fphilipe
269
- [@gotrevor]: https://github.com/gotrevor
270
- [@awwaiid]: https://github.com/awwaiid
271
- [@segiddins]: https://github.com/segiddins
272
- [@urbanautomaton]: https://github.com/urbanautomaton.com
273
- [@unmanbearpig]: https://github.com/unmanbearpig
274
- [@maxjacobson]: https://github.com/maxjacobson
275
- [@sliuu]: https://github.com/sliuu
276
- [@edmz]: https://github.com/edmz
277
- [@syndbg]: https://github.com/syndbg
278
- [@wli]: https://github.com/wli
279
- [@caseywebdev]: https://github.com/caseywebdev
280
- [@MGerrior]: https://github.com/MGerrior
281
- [@imtayadeway]: https://github.com/imtayadeway
282
- [@mrfoto]: https://github.com/mrfoto
283
- [@karreiro]: https://github.com/karreiro
284
- [@dreyks]: https://github.com/dreyks
285
- [@hmadison]: https://github.com/hmadison
286
- [@miquella]: https://github.com/miquella
287
- [@jhansche]: https://github.com/jhansche
288
- [@cornelius]: https://github.com/cornelius
289
- [@eagletmt]: https://github.com/eagletmt
290
- [@apiology]: https://github.com/apiology
291
- [@alexdowad]: https://github.com/alexdowad
292
- [@minustehbare]: https://github.com/minustehbare
293
- [@tansaku]: https://github.com/tansaku
294
- [@ptrippett]: https://github.com/ptrippett
295
- [@br3nda]: https://github.com/br3nda
296
- [@jujugrrr]: https://github.com/jujugrrr
297
- [@sometimesfood]: https://github.com/sometimesfood
298
- [@cgriego]: https://github.com/cgriego
299
- [@savef]: https://github.com/savef
300
- [@volmer]: https://github.com/volmer
301
- [@domcleal]: https://github.com/domcleal
302
- [@codebeige]: https://github.com/codebeige
303
- [@weh]: https://github.com/weh
304
- [@bfontaine]: https://github.com/bfontaine
305
- [@jawshooah]: https://github.com/jawshooah
306
- [@DNNX]: https://github.com/DNNX
307
- [@mvidner]: https://github.com/mvidner