Skip to content

Commit

Permalink
feat: support for the new ruff formatter (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
bellini666 authored Oct 28, 2023
1 parent dc9b7e2 commit 28dd061
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions lua/null-ls/builtins/formatting/ruff_format.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
local methods = require("null-ls.methods")
local h = require("null-ls.helpers")

local FORMATTING = methods.internal.FORMATTING

return h.make_builtin({
name = "ruff",
meta = {
url = "https://github.com/charliermarsh/ruff/",
description = "An extremely fast Python linter and formatter, written in Rust.",
},
method = FORMATTING,
filetypes = { "python" },
generator_opts = {
command = "ruff",
args = { "format", "-n", "--stdin-filename", "$FILENAME", "-" },
to_stdin = true,
},
factory = h.formatter_factory,
})

0 comments on commit 28dd061

Please sign in to comment.