Skip to content

Commit

Permalink
Cut 1.22.2
Browse files Browse the repository at this point in the history
  • Loading branch information
bbatsov committed Oct 22, 2021
1 parent cc7ac48 commit 60484a7
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Expand Up @@ -38,7 +38,7 @@ output by `rubocop -V`, include them as well. Here's an example:

```
$ [bundle exec] rubocop -V
1.22.1 (using Parser 2.7.2.0, rubocop-ast 1.1.1, running on ruby 2.7.2 x86_64-linux)
1.22.2 (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
Expand Up @@ -2,6 +2,8 @@

## master (unreleased)

## 1.22.2 (2021-10-22)

### Bug fixes

* [#10165](https://github.com/rubocop/rubocop/issues/10165): Fix `Layout/DotPosition` false positives when the selector and receiver are on the same line. ([@dvandersluis][])
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Expand Up @@ -17,7 +17,7 @@ do so.

```
$ rubocop -V
1.22.1 (using Parser 2.7.2.0, rubocop-ast 1.1.1, running on ruby 2.7.2 x86_64-linux)
1.22.2 (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
4 changes: 2 additions & 2 deletions config/default.yml
Expand Up @@ -262,7 +262,7 @@ Gemspec/RequiredRubyVersion:
Description: 'Checks that `required_ruby_version` of gemspec is specified and equal to `TargetRubyVersion` of .rubocop.yml.'
Enabled: true
VersionAdded: '0.52'
VersionChanged: '<<next>>'
VersionChanged: '1.22'
Include:
- '**/*.gemspec'

Expand Down Expand Up @@ -2754,7 +2754,7 @@ Security/JSONLoad:
Reference: 'https://ruby-doc.org/stdlib-2.7.0/libdoc/json/rdoc/JSON.html#method-i-load'
Enabled: true
VersionAdded: '0.43'
VersionChanged: '<<next>>'
VersionChanged: '1.22'
# Autocorrect here will change to a method that may cause crashes depending
# on the value of the argument.
SafeAutoCorrect: false
Expand Down
2 changes: 1 addition & 1 deletion docs/antora.yml
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.22'
nav:
- modules/ROOT/nav.adoc
16 changes: 11 additions & 5 deletions docs/modules/ROOT/pages/cops_gemspec.adoc
Expand Up @@ -190,13 +190,14 @@ spec.add_dependency 'rspec'
| Yes
| No
| 0.52
| 0.89
| 1.22
|===

Checks that `required_ruby_version` of gemspec is specified and
equal to `TargetRubyVersion` of .rubocop.yml.
Thereby, RuboCop to perform static analysis working on the version
required by gemspec.
Checks that `required_ruby_version` in a gemspec file is set to a valid
value (non-blank) and matches `TargetRubyVersion` as set in RuboCop's
configuration for the gem.

This ensures that RuboCop is using the same Ruby version as the gem.

=== Examples

Expand All @@ -219,6 +220,11 @@ Gem::Specification.new do |spec|
spec.required_ruby_version = '>= 2.6.0'
end
# bad
Gem::Specification.new do |spec|
spec.required_ruby_version = ''
end
# good
Gem::Specification.new do |spec|
spec.required_ruby_version = '>= 2.5.0'
Expand Down
3 changes: 3 additions & 0 deletions docs/modules/ROOT/pages/cops_metrics.adoc
Expand Up @@ -462,6 +462,9 @@ The maximum number of parameters is configurable.
Keyword arguments can optionally be excluded from the total count,
as they add less complexity than positional or optional parameters.

NOTE: Explicit block argument `&block` is not counted to prevent
erroneous change that is avoided by making block argument implicit.

This cop also checks for the maximum number of optional parameters.
This can be configured using the `MaxOptionalParameters` config option.

Expand Down
14 changes: 2 additions & 12 deletions docs/modules/ROOT/pages/cops_security.adoc
Expand Up @@ -73,15 +73,15 @@ IO.read('| command') # Allow intentional command invocation.
| Yes
| Yes (Unsafe)
| 0.43
| 0.44
| 1.22
|===

This cop checks for the use of JSON class methods which have potential
security issues.

=== Safety

Autocorrect is disabled by default because it's potentially dangerous.
This cop's autocorrection is unsafe because it's potentially dangerous.
If using a stream, like `JSON.load(open('file'))`, it will need to call
`#read` manually, like `JSON.parse(open('file').read)`.
If reading single values (rather than proper JSON objects), like
Expand All @@ -101,16 +101,6 @@ JSON.restore("{}")
JSON.parse("{}")
----

=== Configurable attributes

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

| AutoCorrect
| `false`
| Boolean
|===

=== References

* https://ruby-doc.org/stdlib-2.7.0/libdoc/json/rdoc/JSON.html#method-i-load
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/version.rb
Expand Up @@ -3,7 +3,7 @@
module RuboCop
# This module holds the RuboCop version information.
module Version
STRING = '1.22.1'
STRING = '1.22.2'

MSG = '%<version>s (using Parser %<parser_version>s, '\
'rubocop-ast %<rubocop_ast_version>s, ' \
Expand Down
22 changes: 22 additions & 0 deletions relnotes/v1.22.2.md
@@ -0,0 +1,22 @@
### Bug fixes

* [#10165](https://github.com/rubocop/rubocop/issues/10165): Fix `Layout/DotPosition` false positives when the selector and receiver are on the same line. ([@dvandersluis][])
* [#10171](https://github.com/rubocop/rubocop/pull/10171): Fix `Style/HashTransformKeys` and `Style/HashTransformValues` incorrect auto-correction when inside block body. ([@franzliedke][])

[@franzliedke]: https://github.com/franzliedke
* [#10180](https://github.com/rubocop/rubocop/issues/10180): Fix an error for `Style/SelectByRegexp` when using `match?` without a receiver. ([@koic][])
* [#10193](https://github.com/rubocop/rubocop/pull/10193): Fix an error for `Layout/EmptyLinesAroundExceptionHandlingKeywords` when `begin` and `rescue` are on the same line. ([@koic][])
* [#10185](https://github.com/rubocop/rubocop/issues/10185): Fix a false positive for `Lint/AmbiguousRange` when using `self` in a range literal. ([@koic][])
* [#10200](https://github.com/rubocop/rubocop/issues/10200): Fix an error when inspecting a directory named `*`. ([@koic][])
* [#10149](https://github.com/rubocop/rubocop/pull/10149): Fix `Bundler/GemComment` where it would not detect an offense in some cases when `OnlyFor` is set to `restrictive_version_specifiers`. ([@Drowze][])

### Changes

* [#10157](https://github.com/rubocop/rubocop/pull/10157): Updated `Gemspec/RequiredRubyVersion` handle being set to blank values. ([@dvandersluis][])
* [#10176](https://github.com/rubocop/rubocop/pull/10176): Unmark `AutoCorrect: false` from `Security/JSONLoad`. ([@koic][])
* [#10186](https://github.com/rubocop/rubocop/issues/10186): Explicit block arg is not counted for `Metrics/ParameterLists`. ([@koic][])

[@dvandersluis]: https://github.com/dvandersluis
[@franzliedke]: https://github.com/franzliedke
[@koic]: https://github.com/koic
[@Drowze]: https://github.com/Drowze

1 comment on commit 60484a7

@maxjacobson
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW, it doesn't appear that this change made it into the release:

#10165: Fix Layout/DotPosition false positives when the selector and receiver are on the same line. (@dvandersluis)

I'm eagerly awaiting that one and got excited for it. I will be patient though!

Please sign in to comment.