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

Allow configuring linters separate from formatter #1925

Merged
merged 4 commits into from
Apr 22, 2024

Conversation

vinistock
Copy link
Member

@vinistock vinistock commented Apr 12, 2024

Motivation

Closes #1924

Since addons will now be able to register more linters, we need to account for the fact that users may want to lint with multiple tools that are different from their formatter. I suggest we allow configuring an array of linter identifiers, so that we'll gather diagnostics from all of those.

Note: when it comes to auto-formatting, I do not believe we should use all linters for it. I think it's best to follow the example of the TypeScript and Rust community, where linting errors are fixable via code actions, but not through formatting. Users can then configure to have code actions fixed on save with

{
  "[ruby]": {
    "editor.codeActionsOnSave": {
      "source.fixAll": "explicit"
    }
  }
}

Implementation

I split by commit.

  1. Started remembering the configured linters
  2. Started using all of them for diagnostics
  3. Added the setting to the VS Code extension

Automated Tests

Adjusted our tests.

@vinistock vinistock added enhancement New feature or request server This pull request should be included in the server gem's release notes labels Apr 12, 2024
@vinistock vinistock self-assigned this Apr 12, 2024
@vinistock vinistock requested a review from a team as a code owner April 12, 2024 20:14
@vinistock vinistock requested review from andyw8 and st0012 April 12, 2024 20:14
@vinistock vinistock force-pushed the vs/allow_separate_linter_configuration branch from 1326854 to 019c876 Compare April 22, 2024 19:48
@vinistock vinistock enabled auto-merge (squash) April 22, 2024 20:01
@vinistock vinistock merged commit 70cb714 into main Apr 22, 2024
41 of 42 checks passed
@vinistock vinistock deleted the vs/allow_separate_linter_configuration branch April 22, 2024 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request 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.

No RuboCop diagnostics when Syntax Tree is set as formatter
3 participants