emekdahl / vscode-sqlfluff

An extension to use the sqlfluff linter in vscode.

Home Page:https://marketplace.visualstudio.com/items?itemName=dorzey.vscode-sqlfluff

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

vscode-sqlfluff

.github/workflows/ci.yml

A linter and auto-formatter for SQLFluff, a popular linting tool for SQL and dbt.

linter in action

You can run Format Document to fix the linting violations. You cannot run Format Selection. Please note that not all linting violations are automatically fixable.

Configuration

The extension expects sqlfluff to be installed and already added to the path. If it is installed but cannot be found, add the path to your preferences as seen below.

plugin configuration

By default the linter will lint on the fly but can be changed to linting as you save. Note that linting on save is most useful when auto-save is on.

The linter will work on files with the language mode set to sql or jinja-sql. The screen capture below shows you how to switch it.

switch language mode

Format file

By default you will be able use SQLFluff fix your file by formatting. Same as calling sqlfluff fix --force --no-safey <path>

plugin configuration

Acknowledgements

The extension is based off of the ruby linter extension.

About

An extension to use the sqlfluff linter in vscode.

https://marketplace.visualstudio.com/items?itemName=dorzey.vscode-sqlfluff

License:MIT License


Languages

Language:TypeScript 100.0%