Giter VIP home page Giter VIP logo

vscode-sqlfluff's Introduction

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. Find the path by typing which sqlfluff into your terminal.

Edit your VS Code settings.json file either through the UI or by manually updating the file. The gif below shows the UI path.

plugin configuration

If you want to manually update the settings.json file, open the VS Code command palette and type in settings.json. Select Preferences: Open Settings. Then, add the following two lines to settings.json.

"sql.linter.executablePath": "<PATH_TO_YOUR_SQLFLUFF_FROM_WHICH_SQLFLUFF_COMMAND",
"sql.linter.run": "onType"

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

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.

vscode-sqlfluff's People

Contributors

dorzey avatar emekdahl avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.