For neovim:null_ls use ruff builtin for formatting (#2386)

null_ls picked up the recommended snippet in README.md and ruff formatting now a builtin.

Ref:
1. 482990e391

2. 7b2b28e207/doc/BUILTINS.md (ruff-1)
This commit is contained in:
Hassan Kibirige 2023-01-31 15:22:14 +03:00 committed by GitHub
parent 1b0748d19d
commit da4618d77b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 21 deletions

View File

@ -1541,30 +1541,10 @@ tools:
```lua ```lua
local null_ls = require("null-ls") local null_ls = require("null-ls")
local methods = require("null-ls.methods")
local helpers = require("null-ls.helpers")
local function ruff_fix()
return helpers.make_builtin({
name = "ruff",
meta = {
url = "https://github.com/charliermarsh/ruff/",
description = "An extremely fast Python linter, written in Rust.",
},
method = methods.internal.FORMATTING,
filetypes = { "python" },
generator_opts = {
command = "ruff",
args = { "--fix", "-e", "-n", "--stdin-filename", "$FILENAME", "-" },
to_stdin = true
},
factory = helpers.formatter_factory
})
end
null_ls.setup({ null_ls.setup({
sources = { sources = {
ruff_fix(), null_ls.builtins.formatting.ruff,
null_ls.builtins.diagnostics.ruff, null_ls.builtins.diagnostics.ruff,
} }
}) })