Format with non-LSP ruff

This commit is contained in:
Jan Hamal Dvořák 2025-02-07 14:59:55 +01:00
parent 6a3c123981
commit 751dceda4a
Signed by: mordae
GPG key ID: 1782BCC23EE007B9
2 changed files with 8 additions and 7 deletions

View file

@ -8,6 +8,7 @@ require('nvim-format-buffer').setup({
return 'prettier --stdin-filepath ' .. vim.api.nvim_buf_get_name(0)
end,
},
{ pattern = { "*.sql" }, command = "pg_format --spaces=2 --wrap-limit=1000 --no-rcfile" }
{ pattern = { "*.sql" }, command = "pg_format --spaces=2 --wrap-limit=1000 --no-rcfile" },
{ pattern = { "*.py", "*.pyi" }, command = "ruff check --select I --fix --silent - | ruff format -" }
},
})

View file

@ -18,11 +18,11 @@ vim.api.nvim_create_autocmd("FileType", {
},
})
vim.api.nvim_create_autocmd("BufWritePre", {
pattern = { "*.py", "*.pyi" },
callback = function()
vim.lsp.buf.format({ timeout_ms = 2000 })
end,
})
-- vim.api.nvim_create_autocmd("BufWritePre", {
-- pattern = { "*.py", "*.pyi" },
-- callback = function()
-- vim.lsp.buf.format { timeout_ms = 2000 }
-- end,
-- })
end,
})