GithubHelp home page GithubHelp logo

Comments (2)

creativenull avatar creativenull commented on June 10, 2024

Whoops I thought I did add this but guess I didn't get around to it πŸ˜…

Thanks for pointing it out!

from efmls-configs-nvim.

Anthony-Fiddes avatar Anthony-Fiddes commented on June 10, 2024

Edit: I was mistaken. I didn't realize that sqlfluff gives a non-zero exit code when it finds anything to lint. Probably better to just override the command once like so if you want a config file to work

local which_sqlfluff = fs.executable("sqlfluff")
-- I'd prefer that dialect was set from the nearest sqlfluff file
local sqlfluff_command =
  string.format("%s lint --format github-annotation-native --annotation-level warning --nocolor --disable-progress-bar ${INPUT}", which_sqlfluff)
sqlfluff = vim.tbl_extend("force", sqlfluff, { lintCommand = sqlfluff_command })

Just commenting my gross config to have the command read from a .sqlfluff config file if it's available if it helps anyone:

local which_sqlfluff = fs.executable("sqlfluff")
-- I'd prefer that dialect was set from the nearest sqlfluff file
local sqlfluff_main_command =
  string.format("%s lint --format github-annotation-native --annotation-level warning --nocolor --disable-progress-bar ${INPUT}", which_sqlfluff)
-- If it fails default to ANSI
local sqlfluff_backup_command =
  string.format("%s lint --dialect ansi --format github-annotation-native --annotation-level warning --nocolor --disable-progress-bar ${INPUT}", which_sqlfluff)
local sqlfluff_command = string.format("%s || %s", sqlfluff_main_command, sqlfluff_backup_command)
sqlfluff = vim.tbl_extend("force", sqlfluff, { lintCommand = sqlfluff_command })

from efmls-configs-nvim.

Related Issues (20)

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.