npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

coc-sqlfluff

v0.11.4

Published

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

Downloads

101

Readme

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

  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

  • sqlfluff.enable: Enable coc-sqlfluff extension, default: true
  • sqlfluff.commandPath: The path to the sqlfluff command (Absolute path), default: ""
  • sqlfluff.builtin.pythonPath: Python 3.x path (Absolute path) to be used for built-in install, default: ""
  • sqlfluff.dialect: The dialect of SQL to lint, valid option: ["ansi", "bigquery", "clickhouse", "databricks", "db2", "duckdb", "exasol", "hive", "mysql", "oracle", "postgres", "redshift", "snowflake", "soql", "sparksql", "sqlite", "teradata", "tsql"], default: "ansi"
  • sqlfluff.linter.ignoreParsing: Whether the sql linter should ignore parsing errors, default: true
  • sqlfluff.lintOnOpen: Lint file on opening, default: true
  • sqlfluff.lintOnChange: Lint file on change, default: true
  • sqlfluff.lintOnSave: Lint file on save, default: true
  • sqlfluff.formatEnable: Whether the document formatter is enabled or not, default: true
  • sqlfluff.formatIgnoreStderrAlert: Ignore stderr message output when formatting is executed, e.g. Unfixable violations detected, default: true

Commands

  • sqlfluff.install: Install sqlfluff
    • It will be installed in this path:
      • Mac/Linux: ~/.config/coc/extensions/coc-sqlfluff-data/sqlfluff/venv/bin/sqlfluff
      • Windows: ~/AppData/Local/coc/extensions/coc-sqlfluff-data/sqlfluff/venv/Scripts/sqlfluff.exe
  • 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

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