Skip to content

Commit

Permalink
Cut 1.56
Browse files Browse the repository at this point in the history
  • Loading branch information
bbatsov committed Aug 9, 2023
1 parent 3036b2c commit e597ca1
Show file tree
Hide file tree
Showing 12 changed files with 133 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ output by `rubocop -V`, include them as well. Here's an example:

```
$ [bundle exec] rubocop -V
1.55.1 (using Parser 2.7.2.0, rubocop-ast 1.1.1, running on ruby 2.7.2) [x86_64-linux]
1.56.0 (using Parser 2.7.2.0, rubocop-ast 1.1.1, running on ruby 2.7.2) [x86_64-linux]
- rubocop-performance 1.9.1
- rubocop-rspec 2.0.0
```
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

## master (unreleased)

## 1.56.0 (2023-08-09)

### New features

* [#12074](https://github.com/rubocop/rubocop/pull/12074): Add new `Bundler/DuplicatedGroup` cop. ([@OwlKing][])
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ do so.

```console
$ rubocop -V
1.55.1 (using Parser 2.7.2.0, rubocop-ast 1.1.1, running on ruby 2.7.2) [x86_64-linux]
1.56.0 (using Parser 2.7.2.0, rubocop-ast 1.1.1, running on ruby 2.7.2) [x86_64-linux]
- rubocop-performance 1.9.1
- rubocop-rspec 2.0.0
```
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ To prevent an unwanted RuboCop update you might want to use a conservative versi
in your `Gemfile`:

```rb
gem 'rubocop', '~> 1.55', require: false
gem 'rubocop', '~> 1.56', require: false
```

See [our versioning policy](https://docs.rubocop.org/rubocop/versioning.html) for further details.
Expand Down
2 changes: 1 addition & 1 deletion config/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ Bundler/DuplicatedGroup:
Description: 'Checks for duplicate group entries in Gemfile.'
Enabled: true
Severity: warning
VersionAdded: '<<next>>'
VersionAdded: '1.56'
Include:
- '**/*.gemfile'
- '**/Gemfile'
Expand Down
2 changes: 1 addition & 1 deletion docs/antora.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ name: rubocop
title: RuboCop
# We always provide version without patch here (e.g. 1.1),
# as patch versions should not appear in the docs.
version: ~
version: '1.56'
nav:
- modules/ROOT/nav.adoc
1 change: 1 addition & 0 deletions docs/modules/ROOT/pages/cops.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ In the following section you find all available cops:
=== Department xref:cops_bundler.adoc[Bundler]

* xref:cops_bundler.adoc#bundlerduplicatedgem[Bundler/DuplicatedGem]
* xref:cops_bundler.adoc#bundlerduplicatedgroup[Bundler/DuplicatedGroup]
* xref:cops_bundler.adoc#bundlergemcomment[Bundler/GemComment]
* xref:cops_bundler.adoc#bundlergemfilename[Bundler/GemFilename]
* xref:cops_bundler.adoc#bundlergemversion[Bundler/GemVersion]
Expand Down
64 changes: 64 additions & 0 deletions docs/modules/ROOT/pages/cops_bundler.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,70 @@ end
| Array
|===

== Bundler/DuplicatedGroup

|===
| Enabled by default | Safe | Supports autocorrection | Version Added | Version Changed

| Enabled
| Yes
| No
| 1.56
| -
|===

A Gem group, or a set of groups, should be listed only once in a Gemfile.

=== Examples

[source,ruby]
----
# bad
group :development do
gem 'rubocop'
end
group :development do
gem 'rubocop-rails'
end
# bad (same set of groups declared twice)
group :development, :test do
gem 'rubocop'
end
group :test, :development do
gem 'rspec'
end
# good
group :development do
gem 'rubocop'
end
group :development, :test do
gem 'rspec'
end
# good
gem 'rubocop', groups: [:development, :test]
gem 'rspec', groups: [:development, :test]
----

=== Configurable attributes

|===
| Name | Default value | Configurable values

| Severity
| `warning`
| String

| Include
| `+**/*.gemfile+`, `+**/Gemfile+`, `+**/gems.rb+`
| Array
|===

== Bundler/GemComment

|===
Expand Down
37 changes: 31 additions & 6 deletions docs/modules/ROOT/pages/cops_style.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -11993,11 +11993,16 @@ def test
return something
end
# good
# bad
def test
return something if something_else
end
# good
def test
something if something_else
end
# good
def test
if x
Expand Down Expand Up @@ -14126,7 +14131,7 @@ Checks if uses of quotes match the configured preference.
| -
|===

Checks that quotes inside the string interpolation
Checks that quotes inside string, symbol, and regexp interpolations
match the configured preference.

=== Examples
Expand All @@ -14136,21 +14141,41 @@ match the configured preference.
[source,ruby]
----
# bad
result = "Tests #{success ? "PASS" : "FAIL"}"
string = "Tests #{success ? "PASS" : "FAIL"}"
symbol = :"Tests #{success ? "PASS" : "FAIL"}"
heredoc = <<~TEXT
Tests #{success ? "PASS" : "FAIL"}
TEXT
regexp = /Tests #{success ? "PASS" : "FAIL"}/
# good
result = "Tests #{success ? 'PASS' : 'FAIL'}"
string = "Tests #{success ? 'PASS' : 'FAIL'}"
symbol = :"Tests #{success ? 'PASS' : 'FAIL'}"
heredoc = <<~TEXT
Tests #{success ? 'PASS' : 'FAIL'}
TEXT
regexp = /Tests #{success ? 'PASS' : 'FAIL'}/
----

==== EnforcedStyle: double_quotes

[source,ruby]
----
# bad
result = "Tests #{success ? 'PASS' : 'FAIL'}"
string = "Tests #{success ? 'PASS' : 'FAIL'}"
symbol = :"Tests #{success ? 'PASS' : 'FAIL'}"
heredoc = <<~TEXT
Tests #{success ? 'PASS' : 'FAIL'}
TEXT
regexp = /Tests #{success ? 'PASS' : 'FAIL'}/
# good
result = "Tests #{success ? "PASS" : "FAIL"}"
string = "Tests #{success ? "PASS" : "FAIL"}"
symbol = :"Tests #{success ? "PASS" : "FAIL"}"
heredoc = <<~TEXT
Tests #{success ? "PASS" : "FAIL"}
TEXT
regexp = /Tests #{success ? "PASS" : "FAIL"}/
----

=== Configurable attributes
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/ROOT/pages/installation.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ in your `Gemfile`:

[source,rb]
----
gem 'rubocop', '~> 1.55', require: false
gem 'rubocop', '~> 1.56', require: false
----

.A Modular RuboCop
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module RuboCop
# This module holds the RuboCop version information.
module Version
STRING = '1.55.1'
STRING = '1.56.0'

MSG = '%<version>s (using Parser %<parser_version>s, ' \
'rubocop-ast %<rubocop_ast_version>s, ' \
Expand Down
28 changes: 28 additions & 0 deletions relnotes/v1.56.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
### New features

* [#12074](https://github.com/rubocop/rubocop/pull/12074): Add new `Bundler/DuplicatedGroup` cop. ([@OwlKing][])
* [#12078](https://github.com/rubocop/rubocop/pull/12078): Make LSP server support `rubocop.formatAutocorrectsAll` execute command. ([@koic][])

### Bug fixes

* [#12106](https://github.com/rubocop/rubocop/issues/12106): Fix a false negative for `Style/RedundantReturn` when returning value with guard clause and `return` is used. ([@koic][])
* [#12095](https://github.com/rubocop/rubocop/pull/12095): Fix a false positive for `Style/Alias` when `EncforcedStyle: prefer_alias` and using `alias` with interpolated symbol argument. ([@koic][])
* [#12098](https://github.com/rubocop/rubocop/pull/12098): Fix a false positive for `Style/ClassEqualityComparison` when comparing interpolated string class name for equality. ([@koic][])
* [#12102](https://github.com/rubocop/rubocop/pull/12102): Fix an error for `Style/LambdaCall` when using nested lambda call `x.().()`. ([@koic][])
* [#12099](https://github.com/rubocop/rubocop/pull/12099): Fix an incorrect autocorrect for `Style/Alias` when `EncforcedStyle: prefer_alias_method` and using `alias` with interpolated symbol argument. ([@koic][])
* [#12085](https://github.com/rubocop/rubocop/issues/12085): Fix an error for `Lint/SuppressedException` when `AllowNil: true` is set and endless method definition is used. ([@koic][])
* [#12087](https://github.com/rubocop/rubocop/issues/12087): Fix false positives for `Style/ArgumentsForwarding` with additional args/kwargs in def/send nodes. ([@owst][])
* [#12071](https://github.com/rubocop/rubocop/issues/12071): Fix `Style/SymbolArray` false positives when using square brackets or interpolation in a symbol literal in a percent style array. ([@jasondoc3][])
* [#12061](https://github.com/rubocop/rubocop/issues/12061): Support regex in StringLiteralsInInterpolation. ([@jonas054][])
* [#12091](https://github.com/rubocop/rubocop/pull/12091): With `--fail-level A` ignore non-correctable offenses at :info severity. ([@naveg][])

### Changes

* [#12094](https://github.com/rubocop/rubocop/pull/12094): Add `base64` gem to runtime dependency to suppress Ruby 3.3's warning. ([@koic][])

[@OwlKing]: https://github.com/OwlKing
[@koic]: https://github.com/koic
[@owst]: https://github.com/owst
[@jasondoc3]: https://github.com/jasondoc3
[@jonas054]: https://github.com/jonas054
[@naveg]: https://github.com/naveg

0 comments on commit e597ca1

Please sign in to comment.