coc-sqlfluff
yaegassySQLFluff (A SQL linter and auto-formatter for Humans) extension for coc.nvim
Published Package Summary
coc-sqlfluff
SQLFluff (A SQL linter and auto-formatter for Humans) extension for coc.nvim
Features
- Lint
- Format
- Code Action
- Built-in installer
Install
CocInstall:
:CocInstall coc-sqlfluff
vim-plug:
Plug 'yaegassy/coc-sqlfluff', {'do': 'yarn install --frozen-lockfile'}
Detect: sqlfluff
sqlfluff.commandPathsetting- PATH environment (e.g. system global PATH or venv, etc ...)
- 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
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:
Ignoring Errors for current line (-- noqa)Ignoring Errors for current line (-- noqa: disable=all)Ignoring Errors for current line (-- noqa: enable=all)Show web documentation for {RULE_ID}
Thanks
License
MIT
This extension is built with create-coc-extension
- SQLFluff (A SQL linter and auto-formatter for Humans) extension for coc.nvim
- onLanguage:sql
- onLanguage:jinja-sql
Want to build, test, or contribute to coc.nvim extensions? Explore our official SDK and testing toolkits.
Open Developer GuideVersion History
This published npm package does not include a history.md or changelog.md file. Browse its npm versions or repository releases for available release information.
Contributed Commands
All contributes.commands entries from the published package manifest for coc-sqlfluff@0.11.4.
| Command (:CocCommand) | Description |
|---|---|
| sqlfluff.install | Install sqlfluff |
| sqlfluff.fix | Run sqlfluff fix file |
| sqlfluff.format | Run sqlfluff format file (Available in sqlfluff `v2.0.0` and later) |
| sqlfluff.showOutput | Show sqlfluff output channel |
Configuration Schema
All contributes.configuration entries from the published package manifest, including each raw property schema for coc-settings.json.
Raw JSON Schema
{
"type": "boolean",
"default": true,
"description": "Enable coc-sqlfluff extension"
}Raw JSON Schema
{
"enum": [
"ansi",
"athena",
"bigquery",
"clickhouse",
"databricks",
"db2",
"duckdb",
"exasol",
"hive",
"mysql",
"oracle",
"postgres",
"redshift",
"snowflake",
"soql",
"sparksql",
"sqlite",
"teradata",
"tsql"
],
"type": "string",
"default": "ansi",
"description": "The dialect of SQL to lint"
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"description": "Lint file on opening"
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"description": "Lint file on save"
}Raw JSON Schema
{
"type": "string",
"default": "",
"description": "The path to the sqlfluff command (Absolute path)"
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"description": "Whether the document formatter is enabled or not."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"description": "Lint file on change"
}Raw JSON Schema
{
"type": "string",
"default": "",
"description": "Python 3.x path (Absolute path) to be used for built-in install"
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"description": "Whether the sql linter should ignore parsing errors."
}Raw JSON Schema
{
"type": "boolean",
"default": true,
"description": "Ignore stderr message output when formatting is executed, e.g. `Unfixable violations detected`"
}