yaegassy / coc-sqlfluff

SQLFluff (A SQL linter and auto-formatter for Humans) extension for coc.nvim
https://www.npmjs.com/package/coc-sqlfluff
MIT License
28 stars 1 forks source link
coc coc-extensions coc-nvim formatter linter neovim sql vim

coc-sqlfluff

SQLFluff (A SQL linter and auto-formatter for Humans) extension for coc.nvim

coc-sqlfluff-demo

Features

Install

CocInstall:

:CocInstall coc-sqlfluff

vim-plug:

Plug 'yaegassy/coc-sqlfluff', {'do': 'yarn install --frozen-lockfile'}

Detect: sqlfluff

  1. sqlfluff.commandPath setting
  2. PATH environment (e.g. system global PATH or venv, etc ...)
  3. builtin: extension-only "venv" (Installation commands are also provided)

Bult-in install

coc-sqlfluff allows you to create an extension-only "venv" and install "sqlfluff".

The first time you use coc-sqlfluff, if sqlfluff is not detected, you will be prompted to do a built-in installation.

You can also run the installation command manually.

:CocCommand sqlfluff.install

SQLFluff configuration file (setup.cfg, tox.ini, pep8.ini, .sqlfluff, pyproject.toml)

SQLFluff is able to read project-specific default values for its command line options, or from a configuration file.

SQLFluff will look for the following files in order. Later files will (if found) will be used to overwrite any vales read from earlier files.

  1. setup.cfg
  2. tox.ini
  3. pep8.ini
  4. .sqlfluff
  5. pyproject.toml

REF:

Configuration options

Commands

Code Actions

Example key mapping (Code Action related):

nmap <silent> ga <Plug>(coc-codeaction-line)

Usage:

In the line with diagnostic message, enter the mapped key (e.g. ga) and you will see a list of code actions that can be performed.

Actions:

Thanks

License

MIT


This extension is built with create-coc-extension