Shopify / Shopify/ruby-lsp

Allow RuboCop hints for non-ruby files

Open
#1,323 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement help-wanted pinned
Dominant language
Ruby
Stars
2k
Forks
281
Avg merge
2h 14m
Merged PRs (30d)
6

Description

This feature is VS Code specific
  • VS Code specific
Use case

Somewhat recently RuboCop introduced 3rd-party templating support, where extensions can extract ruby code from files that RuboCop would normally not understand. https://github.com/rubocop/rubocop/pull/10839

A few examples are

Description

I want inline RuboCop hints for non-ruby files.

Implementation

I'm not sure how this works, currently there is no request fired when opening an erb file for example. So the extension probably needs to advertise on which extensions it can function. I'm not sure how that would work with arbitrary extensions.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how the VS Code extension requests diagnostics when opening an ERB file, since the issue says no request is currently fired. Review the linked RuboCop templating extensions and determine how the extension could advertise supported non-Ruby file extensions. Done means inline RuboCop hints work for supported non-Ruby files without breaking Ruby files.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby, vscode
Domain
developer-experience, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.