Skip to content

Conversation

@adam12
Copy link
Contributor

@adam12 adam12 commented Dec 9, 2025

Motivation

Closes #3845

RubyLSP will helpfully log the formatter and linter detected, but not indicate
how or why it came to that conclusion. This can make it difficult to ascertain
whether the detection was correct.

Implementation

The detection methods for formatters, linters, test libraries, and type checkers
were updated to return not just the detected tool, but also a string indicating
the reason for the detection. The logging statements were updated to include
this reason.

A regular class for the detection result (vs Data) was chosen for Ruby compatibility.

Automated Tests

No tests were addeed specifically for this logging change.

Manual Tests

When running the LSP, you can observe the log messages to see the detection reasons.

Log messages for auto-detected formatters, linters, test libraries,
and type checkers now include the reason why they were detected.

For example:
- "Auto detected formatter: rubocop_internal (direct dependency matching /^rubocop/)"
- "Detected test library: rails (bin/rails present)"

This helps users debug false positives by understanding which
detection heuristics triggered.

Fixes Shopify#3845
@adam12 adam12 requested a review from a team as a code owner December 9, 2025 15:58
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.

Log entries for auto-detected libraries could indicate how they were detected

1 participant