Skip to content

Commit

Permalink
For neovim:null_ls use ruff builtin for formatting (#2386)
Browse files Browse the repository at this point in the history
  • Loading branch information
has2k1 committed Jan 31, 2023
1 parent 1b0748d commit da4618d
Showing 1 changed file with 1 addition and 21 deletions.
22 changes: 1 addition & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1541,30 +1541,10 @@ tools:

```lua
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({
sources = {
ruff_fix(),
null_ls.builtins.formatting.ruff,
null_ls.builtins.diagnostics.ruff,
}
})
Expand Down

0 comments on commit da4618d

Please sign in to comment.