forked from rubocop/rubocop
-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
pull
wants to merge
3,769
commits into
lapolinarweb:master
Choose a base branch
from
rubocop:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[DOC] Fix `Layout/ArgumentAlignment`
… 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
… code ends with a commented continuation
…` 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
…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
…en called on `Set`
…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.
[DOC] Fix config file locations
…-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.
This PR marks `Style/RedundantFormat` as unsafe autocorrect. Fixes #13846.
…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.
…-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
Signed-off-by: Patrick Linnane <[email protected]>
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
…gs with missing hash keys
[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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot]
Can you help keep this open source service alive? 💖 Please sponsor : )