You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
🚀 Feature Request: Add sqlfluff lint and sqlfluff fix Commands for the Current File in VSCode
Summary
Enable the ability to run sqlfluff lint and sqlfluff fix directly from the dbt Power User extension for the currently opened SQL file, without manually retrieving the file path.
Motivation
While sqlfluff has been available for the dbt cloud CLI for a while, running it manually requires specifying the file path each time. This feature would provide a seamless, one-click way to lint and fix SQL files directly within VSCode, improving workflow efficiency for dbt developers.
Proposed Solution
Add new VSCode commands to:
Lint the currently open file: Run dbt sqlfluff lint <current-file> automatically.
Fix the currently open file: Run dbt sqlfluff fix <current-file> automatically.
Lint the entire dbt project or a selected folder: Run dbt sqlfluff lint <selected-path>.
Fix all SQL files in a selected folder: Run dbt sqlfluff fix <selected-path>.
Integrate these commands into the VSCode command palette for quick access.
Additional Context
This feature is primarily a convenience improvement, reducing the need to manually determine file paths before running linting or formatting commands.
Currently, the alternative is to manually run dbtsqlfluff lint or dbt sqlfluff fix from the terminal, which requires finding the full path of the SQL file or specifying the directory. While functional, this adds unnecessary friction, especially for quick linting and formatting during development.
Another workaround is using a general-purpose VSCode task or script, but this lacks direct integration with the dbt Power User extension and does not provide native command palette access or inline problem reporting.
Who will benefit?
This feature will benefit dbt developers and analytics engineers who work with SQL models in dbt projects. Specifically:
dbt Developers: Quickly lint and fix SQL files without leaving VSCode, improving workflow efficiency.
Data Engineers: Maintain consistent SQL formatting across projects without manually specifying file paths.
Teams with SQL Style Guidelines: Organizations enforcing SQL style conventions using sqlfluff can integrate this into daily development without relying on external scripts or manual checks.
This will streamline development and reduce friction when working with dbt projects in VSCode.
Are you willing to submit PR?
Yes I am willing to submit a PR!
The text was updated successfully, but these errors were encountered:
Describe the feature
🚀 Feature Request: Add
sqlfluff lint
andsqlfluff fix
Commands for the Current File in VSCodeSummary
Enable the ability to run
sqlfluff lint
andsqlfluff fix
directly from the dbt Power User extension for the currently opened SQL file, without manually retrieving the file path.Motivation
While
sqlfluff
has been available for the dbt cloud CLI for a while, running it manually requires specifying the file path each time. This feature would provide a seamless, one-click way to lint and fix SQL files directly within VSCode, improving workflow efficiency for dbt developers.Proposed Solution
dbt sqlfluff lint <current-file>
automatically.dbt sqlfluff fix <current-file>
automatically.dbt sqlfluff lint <selected-path>
.dbt sqlfluff fix <selected-path>
.Additional Context
Describe alternatives you've considered
Currently, the alternative is to manually run
dbtsqlfluff lint
ordbt sqlfluff fix
from the terminal, which requires finding the full path of the SQL file or specifying the directory. While functional, this adds unnecessary friction, especially for quick linting and formatting during development.Another workaround is using a general-purpose VSCode task or script, but this lacks direct integration with the dbt Power User extension and does not provide native command palette access or inline problem reporting.
Who will benefit?
This feature will benefit dbt developers and analytics engineers who work with SQL models in dbt projects. Specifically:
sqlfluff
can integrate this into daily development without relying on external scripts or manual checks.This will streamline development and reduce friction when working with dbt projects in VSCode.
Are you willing to submit PR?
The text was updated successfully, but these errors were encountered: