Skip to content

Commit

Permalink
Cut 1.56.3
Browse files Browse the repository at this point in the history
  • Loading branch information
bbatsov committed Sep 11, 2023
1 parent 2c10ba8 commit 796fcb3
Show file tree
Hide file tree
Showing 9 changed files with 69 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.56.2 (using Parser 3.2.2.3, rubocop-ast 1.29.0, running on ruby 3.2.2) [x86_64-linux]
1.56.3 (using Parser 3.2.2.3, rubocop-ast 1.29.0, running on ruby 3.2.2) [x86_64-linux]
- rubocop-performance 1.18.0
- rubocop-rspec 2.23.2
```
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.3 (2023-09-11)

### Bug fixes

* [#12151](https://github.com/rubocop/rubocop/issues/12151): Make `Layout/EmptyLineAfterGuardClause` allow `:nocov:` directive after guard clause. ([@koic][])
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.56.2 (using Parser 3.2.2.3, rubocop-ast 1.29.0, running on ruby 3.2.2) [x86_64-linux]
1.56.3 (using Parser 3.2.2.3, rubocop-ast 1.29.0, running on ruby 3.2.2) [x86_64-linux]
- rubocop-performance 1.18.0
- rubocop-rspec 2.23.2
```
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
20 changes: 19 additions & 1 deletion docs/modules/ROOT/pages/cops_layout.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1330,7 +1330,23 @@ end
| 0.59
|===

Enforces empty line after guard clause
Enforces empty line after guard clause.

This cop allows `# :nocov:` directive after guard clause because
SimpleCov excludes code from the coverage report by wrapping it in `# :nocov:`:

[source,ruby]
----
def foo
# :nocov:
return if condition
# :nocov:
bar
end
----

Refer to SimpleCov's documentation for more details:
https://github.com/simplecov-ruby/simplecov#ignoringskipping-code

=== Examples

Expand Down Expand Up @@ -3701,6 +3717,8 @@ opening HEREDOC tag.

== Layout/HeredocIndentation

NOTE: Required Ruby version: 2.3

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

Expand Down
8 changes: 7 additions & 1 deletion docs/modules/ROOT/pages/cops_lint.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -7070,12 +7070,18 @@ Checks for every useless assignment to local variable in every
scope.
The basic idea for this cop was from the warning of `ruby -cw`:

assigned but unused variable - foo
[source,console]
----
assigned but unused variable - foo
----

Currently this cop has advanced logic that detects unreferenced
reassignments and properly handles varied cases such as branch, loop,
rescue, ensure, etc.

NOTE: Given the assignment `foo = 1, bar = 2`, removing unused variables
can lead to a syntax error, so this case is not autocorrected.

=== Safety

This cop's autocorrection is unsafe because removing assignment from
Expand Down
24 changes: 17 additions & 7 deletions docs/modules/ROOT/pages/cops_style.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,15 @@ can be replaced by `array1.intersect?(array2)`.
The `array1.intersect?(array2)` method is faster than
`(array1 & array2).any?` and is more readable.

In cases like the following, compatibility is not ensured,
so it will not be detected when using block argument.

[source,ruby]
----
([1] & [1,2]).any? { |x| false } # => false
[1].intersect?([1,2]) { |x| false } # => true
----

=== Safety

This cop cannot guarantee that `array1` and `array2` are
Expand Down Expand Up @@ -16156,25 +16165,26 @@ have the same result if reversed.

=== Examples

==== SupportedOperators: ['*', '+', '&'']
==== SupportedOperators: ['*', '+', '&', '|', '^'] (default)

[source,ruby]
----
# bad
1 + x
10 * y
1 + x
1 & z
1 | x
1 ^ x
1 + CONST
# good
60 * 24
x + 1
y * 10
x + 1
z & 1
x | 1
x ^ 1
CONST + 1
# good
1 | x
60 * 24
----

=== Configurable attributes
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.56.2'
STRING = '1.56.3'

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

* [#12151](https://github.com/rubocop/rubocop/issues/12151): Make `Layout/EmptyLineAfterGuardClause` allow `:nocov:` directive after guard clause. ([@koic][])
* [#12195](https://github.com/rubocop/rubocop/issues/12195): Fix a false negative for `Layout/SpaceAfterNot` when a newline is present after `!`. ([@ymap][])
* [#12192](https://github.com/rubocop/rubocop/issues/12192): Fix a false positive for `Layout/RedundantLineBreak` when using quoted symbols with a single newline. ([@ymap][])
* [#12190](https://github.com/rubocop/rubocop/issues/12190): Fix a false positive for `Layout/SpaceAroundOperators` when aligning operators vertically. ([@koic][])
* [#12171](https://github.com/rubocop/rubocop/issues/12171): Fix a false positive for `Style/ArrayIntersect` when using block argument for `Enumerable#any?`. ([@koic][])
* [#12172](https://github.com/rubocop/rubocop/issues/12172): Fix a false positive for `Style/EmptyCaseCondition` when using `return`, `break`, `next` or method call before empty case condition. ([@koic][])
* [#12162](https://github.com/rubocop/rubocop/issues/12162): Fix an error for `Bundler/DuplicatedGroup` when there's a duplicate set of groups and the `group` value contains a splat. ([@koic][])
* [#12182](https://github.com/rubocop/rubocop/issues/12182): Fix an error for `Lint/UselessAssignment` when variables are assigned using chained assignment and remain unreferenced. ([@koic][])
* [#12181](https://github.com/rubocop/rubocop/issues/12181): Fix an incorrect autocorrect for `Lint/UselessAssignment` when variables are assigned with sequential assignment using the comma operator and unreferenced. ([@koic][])
* [#12187](https://github.com/rubocop/rubocop/issues/12187): Fix an incorrect autocorrect for `Style/SoleNestedConditional` when comment is in an empty nested `if` body. ([@ymap][])
* [#12183](https://github.com/rubocop/rubocop/pull/12183): Fix an incorrect autocorrect for `Style/MultilineTernaryOperator` when returning a multiline ternary operator expression with safe navigation method call. ([@koic][])
* [#12168](https://github.com/rubocop/rubocop/issues/12168): Fix bug in `Style/ArgumentsForwarding` when there are repeated send nodes. ([@owst][])
* [#12185](https://github.com/rubocop/rubocop/pull/12185): Set target version for `Layout/HeredocIndentation`. ([@tagliala][])

[@koic]: https://github.com/koic
[@ymap]: https://github.com/ymap
[@owst]: https://github.com/owst
[@tagliala]: https://github.com/tagliala

0 comments on commit 796fcb3

Please sign in to comment.