Skip to content

feat!: allow the linter to return fixes that affect other files#5057

Merged
benfdking merged 1 commit intomainfrom
feat_allow_the_linter_fixes_to_affect_other_files
Jul 29, 2025
Merged

feat!: allow the linter to return fixes that affect other files#5057
benfdking merged 1 commit intomainfrom
feat_allow_the_linter_fixes_to_affect_other_files

Conversation

@benfdking
Copy link
Contributor

  • This change builds the building block to the linter to return violations whose
    fixes affect other files.
  • This is in preparation for the change where nomissingexternalmodels can add a fix
    that will add the model to the external models

- This change builds the building block to the linter to return violations whose
fixes affect other files.
- This is in preparation for the change where nomissingexternalmodels can add a fix
that will add the model to the external models
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR extends the linter functionality to support fixes that can affect multiple files, not just the file being linted. This is a breaking change that adds a required path field to the TextEdit class and updates the LSP context to handle workspace edits across multiple files.

  • Added path field to TextEdit class to specify which file should be modified
  • Updated LSP context to group text edits by file URI and create workspace edits that can span multiple files
  • Modified existing linter rule to include the model path when creating fixes

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
sqlmesh/core/linter/rule.py Added required path field to TextEdit dataclass
sqlmesh/lsp/context.py Updated code action creation to group edits by file and support multi-file workspace edits
sqlmesh/core/linter/rules/builtin.py Added path extraction and validation when creating fixes for the SELECT * rule

@benfdking benfdking merged commit 5ccd57e into main Jul 29, 2025
26 of 27 checks passed
@benfdking benfdking deleted the feat_allow_the_linter_fixes_to_affect_other_files branch July 29, 2025 17:10
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.

3 participants