Skip to content

rubocop: Fix the patch for Parser::Source::Comment#1035

Open
tk0miya wants to merge 1 commit into
ruby:mainfrom
tk0miya:rubocop/update
Open

rubocop: Fix the patch for Parser::Source::Comment#1035
tk0miya wants to merge 1 commit into
ruby:mainfrom
tk0miya:rubocop/update

Conversation

@tk0miya

@tk0miya tk0miya commented May 1, 2026

Copy link
Copy Markdown
Contributor

RuboCop::Ext::Comment should be included into Parser::Source::Comment, not RuboCop::AST::Comment. The current patch is incorrect. This fixes the patch to be applied to the correct class.

ref:

RuboCop::Ext::Comment should be included into Parser::Source::Comment,
not RuboCop::AST::Comment.  The current patch is incorrect.  This fixes
the patch to be applied to the correct class.

ref:

* ruby#1020
* https://github.com/rubocop/rubocop/blob/master/lib/rubocop/ext/comment.rb
@github-actions

github-actions Bot commented May 1, 2026

Copy link
Copy Markdown

@tk0miya Thanks for your contribution!

Please follow the instructions below for each change.
See also: https://github.com/ruby/gem_rbs_collection/blob/main/docs/CONTRIBUTING.md

Available commands

You can use the following commands by commenting on this PR.

  • /merge: Merge this PR if CI passes

rubocop

You changed RBS files for an existing gem.
You need to get approval from the reviewers of this gem.

@kozy4324, please review this pull request.
If this change is acceptable, please make a review comment including APPROVE from here.
Screen Shot 2024-03-19 at 14 13 36

After that, the PR author or the reviewers can merge this PR.
Just comment /merge to merge this PR.

@kozy4324 kozy4324 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@tk0miya
Sorry, I just noticed this. It looks like this may need a fix.

end

module Parser
class Source

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
class Source
module Source

The test output shows:

Duplicated declaration: ::Parser::Source (RBS::DuplicatedDeclarationError)

::Parser::Source is already defined as a module:

Changing this should resolve the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants