Skip to content

Change our internal RuboCop integration identifier - #3067

Merged
vinistock merged 1 commit into
mainfrom
01-15-change_our_internal_rubocop_integration_identifier
Jan 16, 2025
Merged

vinistock merged 1 commit into
mainfrom
01-15-change_our_internal_rubocop_integration_identifier

Conversation

@vinistock

@vinistock vinistock commented Jan 15, 2025 •

Copy link
Copy Markdown
Member

Motivation

This PR addresses point 1 and 2 from #3046

Now that the RuboCop add-on is using the rubocop identifier, we need to change ours to prevent conflicts, while still ensuring that users who are on older versions of RuboCop are getting the right behaviour.

Implementation

Essentially, we are changing our identifier to rubocop_internal.

The only extra logic is falling back when users have explicitly configured their formatter or linter as rubocop. Since that is now owned by RuboCop, but only present on versions higher than v1.70, we need to check the version and ensure that it's actually available or fallback to our internal integration.

Automated Tests

Added tests.

vinistock commented Jan 15, 2025 •

Copy link
Copy Markdown
Member Author

@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 Jan 15, 2025 — with Graphite App
@vinistock
vinistock requested review from andyw8 and st0012 January 15, 2025 19:39
@vinistock
vinistock marked this pull request as ready for review January 15, 2025 19:41
@vinistock
vinistock requested a review from a team as a code owner January 15, 2025 19:41
@vinistock
vinistock force-pushed the 01-15-change_our_internal_rubocop_integration_identifier branch from 8b194c7 to b6f67d1 Compare January 15, 2025 19:45
@vinistock
vinistock force-pushed the 01-15-change_our_internal_rubocop_integration_identifier branch 2 times, most recently from 9793189 to fe108cd Compare January 15, 2025 21:05
Comment thread lib/ruby_lsp/global_state.rb Resolved
Comment thread lib/ruby_lsp/global_state.rb Resolved
@vinistock
vinistock force-pushed the 01-15-change_our_internal_rubocop_integration_identifier branch from fe108cd to 798e8a1 Compare January 16, 2025 14:56
@vinistock
vinistock merged commit 125f722 into main Jan 16, 2025

Copy link
Copy Markdown
Member Author

Merge activity

  • Jan 16, 10:23 AM EST: A user merged this pull request with Graphite.

@vinistock
vinistock deleted the 01-15-change_our_internal_rubocop_integration_identifier branch January 16, 2025 15:23
vinistock added a commit that referenced this pull request Jan 16, 2025
### Motivation

I wanted to upgrade RuboCop to the latest version so that we can verify #3067 is working. After upgrading, I noticed that Tapioca was broken because of our version of Bundler, which is fixed in a recent release - so I upgraded that too.

Then I updated our gem RBIs and fixed any issues. I split commit by commit to make it easier to review.
vinistock added a commit that referenced this pull request Jan 16, 2025
### Motivation

This is a fix for the bug I just introduced in #3067 🤦‍♂️. We cannot assume that the `RuboCop` constant will be defined because projects may use a different formatter. We need to check first.

### Implementation

Started checking if the constant we need is defined as part of the check.

### Automated Tests

Part of why this wasn't caught is because our integration tests were ignoring the response return for the initialize request.

That makes the tests extremely weak because the LSP will actually rescue anything that happens during initialize and then simply return an error back to the client, which means that tests passed despite initialization failing.

I started properly checking for what response was returned, so that we can fail tests if initialization was not successful. Without the fix, tests now properly fail.
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.

2 participants