Skip to content

Check if RuboCop is available before searching for add-on - #3071

Merged
vinistock merged 1 commit into
mainfrom
01-16-check_if_rubocop_is_available_before_searching_for_add-on
Jan 16, 2025
Merged

vinistock merged 1 commit into
mainfrom
01-16-check_if_rubocop_is_available_before_searching_for_add-on

Conversation

@vinistock

@vinistock vinistock commented Jan 16, 2025 •

Copy link
Copy Markdown
Member

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.

Copy link
Copy Markdown
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@vinistock vinistock added server This pull request should be included in the server gem's release notes bugfix This PR will fix an existing bug labels Jan 16, 2025 — with Graphite App
@vinistock
vinistock requested review from andyw8 and st0012 January 16, 2025 15:54
@vinistock
vinistock marked this pull request as ready for review January 16, 2025 15:54
@vinistock
vinistock requested a review from a team as a code owner January 16, 2025 15:54
@vinistock
vinistock merged commit bbd0c84 into main Jan 16, 2025

Copy link
Copy Markdown
Member Author

Merge activity

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

@vinistock
vinistock deleted the 01-16-check_if_rubocop_is_available_before_searching_for_add-on branch January 16, 2025 16:19
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