Skip to content

RuboCop v1.70 incompatibilities and new RuboCop add-on #3046

Open
@vinistock

Description

@vinistock

RuboCop v1.70 added an add-on to provide linting and formatting via the Ruby LSP. This is a great move long term, as it allows RuboCop maintainers to improve the integrations and ensure compatibility across versions.

Unfortunately, this first iteration of the add-on is conflicting with our internal integrations with RuboCop and may cause some issues. Namely, two things may happen:

  1. Namespace conflicts like uninitialized constant RubyLsp::RuboCop::Cop (NameError) #3044
  2. Linter registration conflicts since it's using the same identifier as the one we use internally. This means that the LSP may end up using the add-on version and some features can potentially be missing or other features may break (like watching .rubocop.yml)

Transition plan

We need a transition plan since people will still rely on our internal integrations while they are upgrading RuboCop. It may take a while until the community catches up to the newest versions.

Steps

  • Decide identifier change. If we change ours from rubocop to rubocop_internal, it will avoid the conflict, but it also means that anyone who has configured to use rubocop will try to use the add-on. If the application is on an older version of RuboCop where the add-on is not available, that will fail and no formatting will be available. We can add logic to check for this scenario and try to do the right thing depending on what's available
  • Our automatic detection for linters will need to change as well. We will now need to take the add-on into account if it's available and then decide whether to use the internal or the add-on version
  • Map all feature differences between our internal integrations and the RuboCop add-on, so that we can ensure feature completeness for the community

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions