Skip to content
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

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

Conversation

vinistock
Copy link
Member

@vinistock vinistock commented 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.

Copy link
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
44 checks passed
Copy link
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