Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from rubocop:master #615

Open
wants to merge 3,769 commits into
base: master
Choose a base branch
from
Open

Conversation

pull[bot]
Copy link

@pull pull bot commented Sep 28, 2021

See Commits and Changes for more details.


Created by pull[bot]

Can you help keep this open source service alive? 💖 Please sponsor : )

@pull pull bot added the ⤵️ pull label Sep 28, 2021
koic and others added 29 commits January 12, 2025 10:08
… when calling methods with fully qualified constants

This token doesn't have a nice name, it basically means unary "::".
tCOLON2 would be emitted for `FOO::BAR`, and tCOLON is just a single `:`.

```rb
foo Bar::\
  BAZ
```

and other similar approaches to split a constant to multiple lines doesn't work, so no other
token needs to be added.
[Fix #13679] Fix false positive for `Style/RedundantLineContinuation` when calling methods with fully qualified constants
This PR adds `irb` to Gemfile to suppress the following Ruby 3.5's warnings
when using `bin/console` for development:

```console
$ cd path/to/rubocop
$ ruby -v
ruby 3.5.0dev (2025-01-13T03:12:28Z master 384e6945ac) +PRISM [x86_64-darwin23]
$ bin/console
bin/console:5: warning: irb was loaded from the standard library, but is not part of the default gems starting from Ruby 3.5.0.
You can add irb to your Gemfile or gemspec to silence this warning.
/Users/koic/.rbenv/versions/3.5-dev/lib/ruby/3.5.0+0/irb/input-method.rb:278:
warning: rdoc was loaded from the standard library, but is not part of the default gems starting from Ruby 3.5.0.
You can add rdoc to your Gemfile or gemspec to silence this warning.
```
Add support for safe navigation to `Style/BlockDelimiters`
…` when adding safe navigation to an operator call inside a hash
…c/rubocop/cop/style/redundant_line_continuation_spec.rb`
…on-strings-test

Add missing test for string concatenation using continuations in `spec/rubocop/cop/style/redundant_line_continuation_spec.rb`
[Fix #13685] Fix syntax error introduced by `Lint/SafeNavigationChain` when adding safe navigation to an operator call inside a hash
…` and `assign_inside_condition` enforced style

If `Style/ConditionalAssignment` cop is configured with `assign_inside_condition` enforced style and `unless` node
does not have `else` branch and error occurs.

```console
NoMethodError:
       undefined method `begin_type?' for nil
     Shared Example Group: "single line condition autocorrect" called from ./spec/rubocop/cop/style/conditional_assignment_assign_in_condition_spec.rb:920
     # ./lib/rubocop/cop/style/conditional_assignment.rb:312:in `any?'
     # ./lib/rubocop/cop/style/conditional_assignment.rb:312:in `allowed_single_line?'
     # ./lib/rubocop/cop/style/conditional_assignment.rb:293:in `check_assignment_to_condition'
     # ./lib/rubocop/cop/style/conditional_assignment.rb:236:in `block (2 levels) in <class:ConditionalAssignment>'
```
…gnment-cop-error-on-unless-without-else-and-assign-inside-condition-enforced-style

Fix `Style/ConditionalAssignment` cop error on `unless` without `else` and `assign_inside_condition` enforced style
`ruby-lsp` enables LSP mode (makes sense). Ideally the two requires should happen in isolation, but
for now this prevents it from failing unrelated tests.
…on-eol-comment

Fix false positive in `Style/RedundantLineContinuation` when the ruby  code ends with a commented continuation
[Fix #13683] Prevent `ruby-lsp` from failing unrelated tests
…al-length

Update `Metrics/CollectionLiteralLength` to only register for `[]` when called on `Set`
…-safe-nav

Add support for safe navigation to `Lint/RedundantStringCoercion`
RuboCop does not search in the root directory.
…-safe-nav

Add support for safe navigation to `Lint/UselessNumericOperation`
Fixes #13704.

This PR fixes false positives for `Lint/OutOfRangeRegexpRef`
when matching with `match` using safe navigation.
This PR fixes a false positive for `Style/FrozenStringLiteralComment`
when using the frozen string literal magic comment in Active Admin's arb files.

Fixes #13684.
koic and others added 30 commits February 17, 2025 10:11
This PR marks `Style/RedundantFormat` as unsafe autocorrect.

Fixes #13846.
…ion`

This PR fixes false negatives for `InternalAffairs/ExampleDescription`
when example description contains string interpolation.

Fixes #13850.
…ected

When relative paths are used in a plugin's configuration file under `AllCops: Exclude`,
they must be converted to absolute paths.

Otherwise, the exclusion paths will not match the paths being inspected, and the files will not be excluded.

This issue was reported in rubocop/rubocop-rails#1443.

This issue was previously reported in rubocop/rubocop-rails#187
and is essentially a necessary process for all extension gems.

On a side note, converting to the plugin system allows us to fix such potential bugs across all extension gems in a unified manner.
Of course, there is also the risk of introducing bugs uniformly...
This PR fixes an error for `Style/RedundantFormat`
when a template argument is used without keyword arguments.

Fixes #13844.
This PR fixes false positives for `Lint/UselessConstantScoping`
when a constant is used after `private` access modifier with arguments.

Fixes #13856.
Follow-up to #13844 (comment).

This PR fixes an error for `Style/RedundantFormat`
when numeric placeholders is used in the template argument.
This PR fixes an error for `Lint/UselessConstantScoping`
hen multiple assigning to constants after `private` access modifier.

Fixes #13849.
…ttern` APIs

This PR fixes `ArgumentError` related to two deprecated `AllowedPattern` APIs.

This bug was introduced in #13032,
where arguments passed to methods using `alias` were not expanded properly.

Fixes #13861.
…-giude

Correct a typo in the new plugin migration guide
This PR tweaks the offense message of `Style/RedundantFormat`.
Including the result of calls like `format('%10s', 'beepboop')` in the message
helps users understand the cop's role in identifying cases where a string literal
can be used instead.

Closes #13866.
…h Bundler

Because `Gem.loaded_specs` doesn't contain the gems yet at that point.
The automatic injection of the config was removed, so no config is merged at all.
[Fix #13867] Fix an error for plugins when not running RuboCop through Bundler
plugin/load_error: remove extra tick
Prevent `version_spec` from leaking `ConfigLoader.default_configuration` changes
…ange` is enabled

The `RegexpRanges` class was added to work around a bug in regexp_parser with ocals in ranges.
But, it destructivly removes all expressions from sets because it doesn't dup them.
So, any cop that runs after that wants to look at sets will see nothing at all.

Today, the buggy versions are excluded in the gemspec, so the code can simply be removed.

I didn't add a new test because the code that would be tested is gone now.

It also fixes a false positive for `/[_A-z;&&[^G-f]]/`. This regex only contains a single range, not two.
…me` to specify names that are forbidden
[Fix #13880] Fix `Style/RedundantFormat` when given double-splatted arguments
[Fix #13826] Fix false positives for regex cops when `Lint/MixedCaseRange` is enabled
[Fix #13882] Fix `Style/RedundantFormat` for annotated template strings with missing hash keys
…ation-message

Improve offense message for `Style/LineEndConcatenation`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.