AltimateAI / AltimateAI/vscode-dbt-power-user
Support for SQLFluff with dbt cloud / dbt cloud CLI
- Lingua principale
- JavaScript
- Stelle
- 585
- Fork
- 121
- Merge medio
- 5g 39m
- PR unite (30g)
- 4
Descrizione
### Describe the feature
# 🚀 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 ` automatically.
- **Fix the currently open file**: Run `dbt sqlfluff fix ` automatically.
- **Lint the entire dbt project or a selected folder**: Run `dbt sqlfluff lint `.
- **Fix all SQL files in a selected folder**: Run `dbt sqlfluff fix `.
- 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.
- Reference: [dbt Cloud CLI SQL Linting](https://docs.getdbt.com/docs/cloud/configure-cloud-cli#lint-sql-files)
### Describe alternatives you've considered
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!
Guida per i contributori
Apri la guida per i contributori
Valutazione
Questa issue non è ancora stata valutata.