fix ruff/Ruff duplication

This commit is contained in:
Ray Elliott 2025-12-07 23:48:11 +00:00
commit b56d703662
5 changed files with 50 additions and 8 deletions

View file

@ -45,6 +45,17 @@ return {
-- Note: Diagnostics (linters) moved to nvim-lint plugin
-- Custom ruff formatter (ruff format subcommand)
local ruff_format = {
method = null_ls.methods.FORMATTING,
filetypes = { "python" },
generator = null_ls.formatter({
command = find_executable({ "ruff" }) or "ruff",
args = { "format", "--stdin-filename", "$FILENAME", "-" },
to_stdin = true,
}),
}
null_ls.setup({
sources = {
-- Prettier (JS, TS, CSS, SCSS, JSON, Markdown, HTML)
@ -75,10 +86,8 @@ return {
command = find_executable({ "stylua" }),
}),
-- black (Python)
formatting.black.with({
command = find_executable({ "black" }),
}),
-- ruff (Python formatter - custom since not in builtins)
ruff_format,
},
-- Format on save