Skip to content

Pick up changes from .rubocop-todo.yml #3625

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

AlexVPopov
Copy link

Motivation

Closes #3609

Pick up changes in .rubocop_todo.yml.

Implementation

As suggested by @vinistock, adjust the patterns for rubocop config files.

Automated Tests

I'm not sure all the tests I've added are relevant, I'm open to changing them with some feedback and guidance.

Manual Tests

I couldn't make Cursor use my local version of .ruby-lsp 😬, I'd be happy to get information about how I can test this.

@AlexVPopov AlexVPopov requested a review from a team as a code owner June 22, 2025 20:26
Copy link

graphite-app bot commented Jun 22, 2025

How to use the Graphite Merge Queue

Add the label graphite-merge to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

@AlexVPopov
Copy link
Author

I have signed the CLA!

Copy link
Member

@vinistock vinistock left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! Some minor comments, but this is basically it

Copy link
Member

Choose a reason for hiding this comment

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

The tests here a bit mixed. Some of these are validating other logic using the RuboCop configuration file, but it's not directly related.

Can we please simply make another version of test_rubocop_config_changes_trigger_workspace_diagnostic_refresh that uses the RuboCop todo file instead of .rubocop.yml? That should be enough. And then feel free to extract a common method to test the two of them.

@AlexVPopov AlexVPopov force-pushed the pick-up-rubocop-todo branch from 7131bca to 53df420 Compare June 24, 2025 09:58
Copy link
Member

@vinistock vinistock left a comment

Choose a reason for hiding this comment

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

Just some minor comments and it looks good to ship

".rubocop.yml",
".rubocop",
".rubocop_todo.yml",
] #: Array[String]
Copy link
Member

Choose a reason for hiding this comment

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

Let's freeze it because then Sorbet will automatically know that this is a 3 element Tuple of strings instead of an array of arbitrary size.

Suggested change
] #: Array[String]
].freeze

})

@server.global_state.index.index_all(uris: [])
assert_rubocop_config_triggers_diagnostic_refresh_without_setup(config_file)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
assert_rubocop_config_triggers_diagnostic_refresh_without_setup(config_file)
assert_rubocop_config_triggers_diagnostic_refresh_without_setup(uri)

Comment on lines +1724 to +1726
def assert_rubocop_config_triggers_diagnostic_refresh_without_setup(config_file)
uri = URI::Generic.from_path(path: File.join(Dir.pwd, config_file))

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
def assert_rubocop_config_triggers_diagnostic_refresh_without_setup(config_file)
uri = URI::Generic.from_path(path: File.join(Dir.pwd, config_file))
def assert_rubocop_config_triggers_diagnostic_refresh_without_setup(uri)

@vinistock vinistock added bugfix This PR will fix an existing bug server This pull request should be included in the server gem's release notes labels Jun 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix This PR will fix an existing bug server This pull request should be included in the server gem's release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ruby-lsp not picking up changes in .rubocop-todo.yml
2 participants