Skip to content

Commit 64e8c47

Browse files
committed
Cut 1.6
1 parent 337570f commit 64e8c47

File tree

11 files changed

+71
-28
lines changed

11 files changed

+71
-28
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ output by `rubocop -V`, include them as well. Here's an example:
3838

3939
```
4040
$ [bundle exec] rubocop -V
41-
1.5.2 (using Parser 2.7.2.0, rubocop-ast 1.1.1, running on ruby 2.7.2 x86_64-linux)
41+
1.6.0 (using Parser 2.7.2.0, rubocop-ast 1.1.1, running on ruby 2.7.2 x86_64-linux)
4242
- rubocop-performance 1.9.1
4343
- rubocop-rspec 2.0.0
4444
```

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## master (unreleased)
44

5+
## 1.6.0 (2020-12-09)
6+
57
### New features
68

79
* [#9125](https://github.com/rubocop-hq/rubocop/issues/9125): Allow ConfigObsoletion to be extended by other RuboCop libraries. ([@dvandersluis][])

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ do so.
1717

1818
```
1919
$ rubocop -V
20-
1.5.2 (using Parser 2.7.2.0, rubocop-ast 1.1.1, running on ruby 2.7.2 x86_64-linux)
20+
1.6.0 (using Parser 2.7.2.0, rubocop-ast 1.1.1, running on ruby 2.7.2 x86_64-linux)
2121
- rubocop-performance 1.9.1
2222
- rubocop-rspec 2.0.0
2323
```

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ To prevent an unwanted RuboCop update you might want to use a conservative versi
5151
in your `Gemfile`:
5252

5353
```rb
54-
gem 'rubocop', '~> 1.5', require: false
54+
gem 'rubocop', '~> 1.6', require: false
5555
```
5656

5757
See [versioning](https://docs.rubocop.org/rubocop/1.0/versioning.html) for further details.

config/default.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -3212,7 +3212,7 @@ Style/FloatDivision:
32123212
Reference: 'https://blog.rubystyle.guide/ruby/2019/06/21/float-division.html'
32133213
Enabled: true
32143214
VersionAdded: '0.72'
3215-
VersionChanged: <<next>>
3215+
VersionChanged: '1.6'
32163216
EnforcedStyle: single_coerce
32173217
SupportedStyles:
32183218
- left_coerce
@@ -4026,7 +4026,7 @@ Style/RedundantArgument:
40264026
Enabled: pending
40274027
Safe: false
40284028
VersionAdded: '1.4'
4029-
VersionChanged: <<next>>
4029+
VersionChanged: '1.6'
40304030
Methods:
40314031
# Array#join
40324032
join: ''
@@ -4274,7 +4274,7 @@ Style/SingleLineBlockParams:
42744274
Description: 'Enforces the names of some block params.'
42754275
Enabled: false
42764276
VersionAdded: '0.16'
4277-
VersionChanged: <<next>>
4277+
VersionChanged: '1.6'
42784278
Methods:
42794279
- reduce:
42804280
- acc
@@ -4347,7 +4347,7 @@ Style/StringConcatenation:
43474347
Enabled: true
43484348
Safe: false
43494349
VersionAdded: '0.89'
4350-
VersionChanged: <<next>>
4350+
VersionChanged: '1.6'
43514351

43524352
Style/StringHashKeys:
43534353
Description: 'Prefer symbols instead of strings as hash keys.'

docs/antora.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ name: rubocop
22
title: RuboCop
33
# We always provide version without patch here (e.g. 1.1),
44
# as patch versions should not appear in the docs.
5-
version: 'master'
5+
version: '1.6'
66
nav:
77
- modules/ROOT/nav.adoc

docs/modules/ROOT/pages/cops_naming.adoc

+15-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,13 @@
1212
| -
1313
|===
1414

15-
This cop makes sure that accessor methods are named properly.
15+
This cop makes sure that accessor methods are named properly. Applies
16+
to both instance and class methods.
17+
18+
NOTE: Offenses are only registered for methods with the expected
19+
arity. Getters (`get_attribute`) must have no arguments to be
20+
registered, and setters (`set_attribute(value)`) must have exactly
21+
one.
1622

1723
=== Examples
1824

@@ -33,6 +39,14 @@ end
3339
# good
3440
def attribute
3541
end
42+
43+
# accepted, incorrect arity for getter
44+
def get_value(attr)
45+
end
46+
47+
# accepted, incorrect arity for setter
48+
def set_value
49+
end
3650
----
3751

3852
=== References

docs/modules/ROOT/pages/cops_style.adoc

+18-17
Original file line numberDiff line numberDiff line change
@@ -3390,9 +3390,9 @@ for numbers in the code (eg 1.2e4). Different styles are supported:
33903390

33913391
| Enabled
33923392
| Yes
3393-
| No
3393+
| Yes
33943394
| 0.72
3395-
| -
3395+
| 1.6
33963396
|===
33973397

33983398
This cop checks for division with integers coerced to floats.
@@ -3463,7 +3463,7 @@ a.fdiv(b)
34633463
=== References
34643464

34653465
* https://rubystyle.guide#float-division
3466-
* https://github.com/rubocop-hq/ruby-style-guide/issues/628
3466+
* https://blog.rubystyle.guide/ruby/2019/06/21/float-division.html
34673467

34683468
== Style/For
34693469

@@ -7664,7 +7664,8 @@ This cop checks for usage of the %Q() syntax when %q() would do.
76647664
|===
76657665

76667666
This cop looks for uses of Perl-style regexp match
7667-
backreferences like $1, $2, etc.
7667+
backreferences and their English versions like
7668+
$1, $2, $&, &+, $MATCH, $PREMATCH, etc.
76687669

76697670
=== Examples
76707671

@@ -7895,9 +7896,9 @@ rand(1...7)
78957896

78967897
| Pending
78977898
| No
7898-
| No
7899+
| Yes (Unsafe)
78997900
| 1.4
7900-
| -
7901+
| 1.6
79017902
|===
79027903

79037904
This cop checks for a redundant argument passed to certain methods.
@@ -9581,9 +9582,9 @@ keys = %i[key1 key2]
95819582

95829583
| Disabled
95839584
| Yes
9584-
| No
9585+
| Yes
95859586
| 0.16
9586-
| 0.47
9587+
| 1.6
95879588
|===
95889589

95899590
This cop checks whether the block parameters of a single-line
@@ -9817,10 +9818,6 @@ puts $CHILD_STATUS
98179818
puts $LAST_MATCH_INFO
98189819
puts $IGNORECASE
98199820
puts $ARGV # or ARGV
9820-
puts $MATCH
9821-
puts $PREMATCH
9822-
puts $POSTMATCH
9823-
puts $LAST_PAREN_MATCH
98249821
----
98259822

98269823
==== EnforcedStyle: use_perl_names
@@ -9846,10 +9843,6 @@ puts $?
98469843
puts $~
98479844
puts $=
98489845
puts $*
9849-
puts $&
9850-
puts $`
9851-
puts $'
9852-
puts $+
98539846
----
98549847

98559848
=== Configurable attributes
@@ -10018,7 +10011,7 @@ warn('hello')
1001810011
| No
1001910012
| Yes (Unsafe)
1002010013
| 0.89
10021-
| -
10014+
| 1.6
1002210015
|===
1002310016

1002410017
This cop checks for places where string concatenation
@@ -10029,6 +10022,10 @@ more complex cases where the resulting code would be harder to read.
1002910022
In those cases, it might be useful to extract statements to local
1003010023
variables or methods which you can then interpolate in a string.
1003110024

10025+
NOTE: When concatenation between two strings is broken over multiple
10026+
lines, this cop does not register an offense; instead,
10027+
`Style/LineEndConcatenation` will pick up the offense if enabled.
10028+
1003210029
=== Examples
1003310030

1003410031
[source,ruby]
@@ -10039,6 +10036,10 @@ email_with_name = user.name + ' <' + user.email + '>'
1003910036
# good
1004010037
email_with_name = "#{user.name} <#{user.email}>"
1004110038
email_with_name = format('%s <%s>', user.name, user.email)
10039+
10040+
# accepted, line-end concatenation
10041+
name = 'First' +
10042+
'Last'
1004210043
----
1004310044

1004410045
=== References

docs/modules/ROOT/pages/installation.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ in your `Gemfile`:
2222

2323
[source,rb]
2424
----
25-
gem 'rubocop', '~> 1.5', require: false
25+
gem 'rubocop', '~> 1.6', require: false
2626
----
2727

2828
NOTE: You can check out our progress on the road to version 1.0 https://github.com/rubocop-hq/rubocop/milestone/4[here].

lib/rubocop/version.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
module RuboCop
44
# This module holds the RuboCop version information.
55
module Version
6-
STRING = '1.5.2'
6+
STRING = '1.6.0'
77

88
MSG = '%<version>s (using Parser %<parser_version>s, '\
99
'rubocop-ast %<rubocop_ast_version>s, ' \

relnotes/v1.6.0.md

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
### New features
2+
3+
* [#9125](https://github.com/rubocop-hq/rubocop/issues/9125): Allow ConfigObsoletion to be extended by other RuboCop libraries. ([@dvandersluis][])
4+
* [#9182](https://github.com/rubocop-hq/rubocop/pull/9182): Support auto-correction for `Style/RedundantArgument`. ([@koic][])
5+
* [#9186](https://github.com/rubocop-hq/rubocop/pull/9186): Support auto-correction for `Style/FloatDivision`. ([@koic][])
6+
* [#9167](https://github.com/rubocop-hq/rubocop/pull/9167): Support auto-correct for `StyleSingleLineBlockParams`. ([@koic][])
7+
8+
### Bug fixes
9+
10+
* [#9177](https://github.com/rubocop-hq/rubocop/pull/9177): Remove back-ref related code from `Style/SpecialGlobalVars`. ([@r7kamura][])
11+
* [#9160](https://github.com/rubocop-hq/rubocop/issues/9160): Fix an incorrect auto-correct for `Style/IfUnlessModifier` and `Style/SoleNestedConditional` when auto-correction conflicts for guard condition. ([@koic][])
12+
* [#9174](https://github.com/rubocop-hq/rubocop/issues/9174): Handle send nodes with unparenthesized arguments in `Style/SoleNestedConditional`. ([@dvandersluis][])
13+
* [#9184](https://github.com/rubocop-hq/rubocop/issues/9184): `Layout/EmptyLinesAroundAttributeAccessor` fails if the attr_accessor is the last line of the file. ([@tas50][])
14+
15+
### Changes
16+
17+
* [#9171](https://github.com/rubocop-hq/rubocop/pull/9171): Add "did you mean" message when failing due to invalid cops in configuration. ([@dvandersluis][])
18+
* [#8897](https://github.com/rubocop-hq/rubocop/issues/8897): Change `Style/StringConcatenation` to accept line-end concatenation between two strings so that `Style/LineEndConcatenation` can handle it instead. ([@dvandersluis][])
19+
* [#9172](https://github.com/rubocop-hq/rubocop/pull/9172): Add `Style/PerlBackrefs` targets and change message more detailed. ([@r7kamura][])
20+
* [#9187](https://github.com/rubocop-hq/rubocop/pull/9187): Update formatters to output `[Correctable]` for correctable offenses. ([@dvandersluis][])
21+
* [#9169](https://github.com/rubocop-hq/rubocop/pull/9169): Add obsoletion warnings for `Performance/*` and `Rails/*` which are in separate gems now. ([@dvandersluis][])
22+
23+
[@dvandersluis]: https://github.com/dvandersluis
24+
[@koic]: https://github.com/koic
25+
[@r7kamura]: https://github.com/r7kamura
26+
[@tas50]: https://github.com/tas50

0 commit comments

Comments
 (0)