Skip to content
This repository has been archived by the owner on Aug 12, 2023. It is now read-only.

Commit

Permalink
feat(ruff): add support for formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
igorlfs committed Dec 10, 2022
1 parent adaa799 commit 482990e
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions lua/null-ls/builtins/formatting/ruff.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, written in Rust.",
},
method = FORMATTING,
filetypes = { "python" },
generator_opts = {
command = "ruff",
args = { "--fix", "-e", "-n", "--stdin-filename", "$FILENAME", "-" },
to_stdin = true,
},
factory = h.formatter_factory,
})

0 comments on commit 482990e

Please sign in to comment.