Compare commits

...

5 commits

Author SHA1 Message Date
raf
c7fe3c1818
Merge pull request #1333 from pyrox0/feat/sqruff
Some checks failed
Set up binary cache / cachix (default) (push) Has been cancelled
Set up binary cache / cachix (maximal) (push) Has been cancelled
Set up binary cache / cachix (nix) (push) Has been cancelled
Treewide Checks / Validate flake (push) Has been cancelled
Treewide Checks / Check formatting (push) Has been cancelled
Treewide Checks / Check source tree for typos (push) Has been cancelled
Treewide Checks / Validate documentation builds (push) Has been cancelled
Treewide Checks / Validate hyperlinks in documentation sources (push) Has been cancelled
Treewide Checks / Validate Editorconfig conformance (push) Has been cancelled
Build and deploy documentation / Check latest commit (push) Has been cancelled
Build and deploy documentation / publish (push) Has been cancelled
languages/sql: support sqruff
2026-01-11 15:39:04 +03:00
raf
dfc3ab667b
Merge branch 'main' into feat/sqruff 2026-01-11 15:20:18 +03:00
2423af38f7
flake: fix formatting checks
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I2e79090e303930b060566aab02f7dd446a6a6964
2026-01-11 15:20:04 +03:00
2d43bc37d0
docs: format release notes
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I2bce19ea88f12af67baa4d777af287dd6a6a6964
2026-01-11 15:19:50 +03:00
dish
54d7f3ddc5 languages/sql: support sqruff 2026-01-10 23:19:57 -05:00
3 changed files with 38 additions and 12 deletions

View file

@ -22,8 +22,8 @@
Some other settings and commands are now deprecated but are still supported.
- The `setupOpts.mappings` options were also removed. Use the built-in
Neovim settings (nvf's {option}`vim.keymaps`)
- The `setupOpts.mappings` options were also removed. Use the built-in Neovim
settings (nvf's {option}`vim.keymaps`)
## Changelog {#sec-release-0-9-changelog}
@ -69,7 +69,8 @@
[jtliang24](https://github.com/jtliang24):
- Updated nix language plugin to use pkgs.nixfmt instead of pkgs.nixfmt-rfc-style
- Updated nix language plugin to use pkgs.nixfmt instead of
pkgs.nixfmt-rfc-style
[alfarel](https://github.com/alfarelcynthesis):
@ -128,3 +129,5 @@
[pyrox0](https://github.com/pyrox0):
- Added [rumdl](https://github.com/rvben/rumdl) support to `languages.markdown`
- Added [sqruff](https://github.com/quarylabs/sqruff) support to `languages.sql`

View file

@ -91,18 +91,29 @@
# Check if codebase is properly formatted.
# This can be initiated with `nix build .#checks.<system>.nix-fmt`
# or with `nix flake check`
nix-fmt = pkgs.runCommand "nix-fmt-check" {nativeBuildInputs = [pkgs.alejandra];} ''
alejandra --check ${self} < /dev/null
touch $out
'';
nix-fmt =
pkgs.runCommand "nix-fmt-check"
{
src = self;
nativeBuildInputs = [pkgs.alejandra pkgs.fd];
} ''
cd "$src"
fd -t f -e nix -x alejandra --check '{}'
touch $out
'';
# Check if Markdown sources are properly formatted
# This can be initiated with `nix build .#checks.<system>.md-fmt`
# or with `nix flake check`
md-fmt = pkgs.runCommand "md-fmt-check" {nativeBuildInputs = [pkgs.deno];} ''
deno fmt --check ${self} --ext md
touch $out
'';
md-fmt =
pkgs.runCommand "md-fmt-check" {
src = self;
nativeBuildInputs = [pkgs.deno pkgs.fd];
} ''
cd "$src"
fd -t f -e md -x deno fmt --check '{}'
touch $out
'';
};
};
};

View file

@ -15,6 +15,7 @@
cfg = config.vim.languages.sql;
sqlfluffDefault = pkgs.sqlfluff;
sqruffDefault = pkgs.sqruff;
defaultServers = ["sqls"];
servers = {
@ -39,6 +40,10 @@
command = getExe sqlfluffDefault;
append_args = ["--dialect=${cfg.dialect}"];
};
sqruff = {
command = getExe sqruffDefault;
append_args = ["--dialect=${cfg.dialect}"];
};
};
defaultDiagnosticsProvider = ["sqlfluff"];
@ -50,6 +55,13 @@
args = ["lint" "--format=json" "--dialect=${cfg.dialect}"];
};
};
sqruff = {
package = sqruffDefault;
config = {
cmd = getExe sqruffDefault;
args = ["lint" "--format=json" "--dialect=${cfg.dialect}" "-"];
};
};
};
in {
options.vim.languages.sql = {
@ -58,7 +70,7 @@ in {
dialect = mkOption {
type = str;
default = "ansi";
description = "SQL dialect for sqlfluff (if used)";
description = "SQL dialect for formatters and diagnostics (if used)";
};
treesitter = {