Skip to content

Commit

Permalink
Cut 1.9.1
Browse files Browse the repository at this point in the history
  • Loading branch information
bbatsov committed Feb 1, 2021
1 parent 26b188c commit 9624818
Show file tree
Hide file tree
Showing 8 changed files with 63 additions and 7 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.9.0 (using Parser 2.7.2.0, rubocop-ast 1.1.1, running on ruby 2.7.2 x86_64-linux)
1.9.1 (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 @@ -2,6 +2,8 @@

## master (unreleased)

## 1.9.1 (2021-02-01)

### New features

* [#9459](https://github.com/rubocop-hq/rubocop/issues/9459): Add `AllowedMethods` option to `Style/IfWithBooleanLiteralBranches` and set `nonzero?` as default value. ([@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.

```
$ rubocop -V
1.9.0 (using Parser 2.7.2.0, rubocop-ast 1.1.1, running on ruby 2.7.2 x86_64-linux)
1.9.1 (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 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: 'master'
version: '1.9'
nav:
- modules/ROOT/nav.adoc
7 changes: 5 additions & 2 deletions docs/modules/ROOT/pages/cops_layout.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2447,11 +2447,14 @@ some_object.method(arg) # this is some comment
|===

This cop checks the indentation of the first argument in a method call.
Arguments after the first one are checked by Layout/ArgumentAlignment,
Arguments after the first one are checked by `Layout/ArgumentAlignment`,
not by this cop.

For indenting the first parameter of method _definitions_, check out
Layout/FirstParameterIndentation.
`Layout/FirstParameterIndentation`.

This cop will respect `Layout/ArgumentAlignment` and will not work when
`EnforcedStyle: with_fixed_indentation` is specified for `Layout/ArgumentAlignment`.

=== Examples

Expand Down
22 changes: 21 additions & 1 deletion docs/modules/ROOT/pages/cops_style.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4768,14 +4768,16 @@ end

| Pending
| Yes
| Yes
| Yes (Unsafe)
| 1.9
| -
|===

This cop checks for redundant `if` with boolean literal branches.
It checks only conditions to return boolean value (`true` or `false`) for safe detection.
The conditions to be checked are comparison methods, predicate methods, and double negative.
However, auto-correction is unsafe because there is no guarantee that all predicate methods
will return boolean value. Those methods can be allowed with `AllowedMethods` config.

=== Examples

Expand All @@ -4795,6 +4797,24 @@ foo == bar ? true : false
foo == bar
----

==== AllowedMethods: ['nonzero?']

[source,ruby]
----
# good
num.nonzero? ? true : false
----

=== Configurable attributes

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

| AllowedMethods
| `nonzero?`
| Array
|===

== Style/IfWithSemicolon

|===
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.9.0'
STRING = '1.9.1'

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

* [#9459](https://github.com/rubocop-hq/rubocop/issues/9459): Add `AllowedMethods` option to `Style/IfWithBooleanLiteralBranches` and set `nonzero?` as default value. ([@koic][])

### Bug fixes

* [#9431](https://github.com/rubocop-hq/rubocop/issues/9431): Fix an error for `Style/DisableCopsWithinSourceCodeDirective` when using leading source comment. ([@koic][])
* [#9444](https://github.com/rubocop-hq/rubocop/issues/9444): Fix error on colorization for offenses with `Severity: info`. ([@tejasbubane][])
* [#9448](https://github.com/rubocop-hq/rubocop/issues/9448): Fix an error for `Style/SoleNestedConditional` when using nested `unless` modifier with a single expression condition. ([@koic][])
* [#9449](https://github.com/rubocop-hq/rubocop/issues/9449): Fix an error for `Style/NilComparison` when using `x == nil` as a guard condition'. ([@koic][])
* [#9440](https://github.com/rubocop-hq/rubocop/issues/9440): Fix `Lint/SymbolConversion` for implicit `to_sym` without a receiver. ([@dvandersluis][])
* [#9453](https://github.com/rubocop-hq/rubocop/issues/9453): Fix infinite loop error for `Layout/FirstParameterIndentation` when `EnforcedStyle: with_fixed_indentation` is specified for `Layout/ArgumentAlignment`. ([@koic][])
* [#9466](https://github.com/rubocop-hq/rubocop/issues/9466): Don't correct `Style/SingleLineMethods` using endless methods if the target ruby is < 3.0. ([@dvandersluis][])
* [#9455](https://github.com/rubocop-hq/rubocop/issues/9455): Fix a false positive for `Lint/SymbolConversion` when hash keys that contain `":"`. ([@koic][])
* [#9454](https://github.com/rubocop-hq/rubocop/issues/9454): Fix an incorrect auto-correct for `Style/IfWithBooleanLiteralBranches` when using `elsif do_something?` with boolean literal branches. ([@koic][])
* [#9438](https://github.com/rubocop-hq/rubocop/issues/9438): Fix a false positive for `Layout/SpaceBeforeBrackets` when space is used in left bracket. ([@koic][])
* [#9457](https://github.com/rubocop-hq/rubocop/issues/9457): Fix a false positive for `Lint/SymbolConversion` when hash keys that end with `=`. ([@koic][])
* [#9473](https://github.com/rubocop-hq/rubocop/issues/9473): Fix an error for `Lint/DeprecatedConstants` when using `__ENCODING__`. ([@koic][])
* [#9452](https://github.com/rubocop-hq/rubocop/pull/9452): Fix `StyleGuideBaseURL` not functioning with nested departments. ([@tas50][])
* [#9465](https://github.com/rubocop-hq/rubocop/issues/9465): Update `Metrics/ParameterLists` to be able to write `MaxOptionalParameters` in rubocop_todo.yml. ([@dvandersluis][])
* [#9433](https://github.com/rubocop-hq/rubocop/issues/9433): Fix an error for `Style/EvalWithLocation` when using eval with block argument. ([@koic][])

### Changes

* [#9437](https://github.com/rubocop-hq/rubocop/issues/9437): Improve offense message when there is an allowed range of empty lines. ([@dvandersluis][])
* [#9476](https://github.com/rubocop-hq/rubocop/pull/9476): Mark `Style/IfWithBooleanLiteralBranche` as unsafe auto-correction. ([@koic][])

[@koic]: https://github.com/koic
[@tejasbubane]: https://github.com/tejasbubane
[@dvandersluis]: https://github.com/dvandersluis
[@tas50]: https://github.com/tas50

0 comments on commit 9624818

Please sign in to comment.