-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support for the new ruff formatter (#10)
- Loading branch information
1 parent
dc9b7e2
commit 28dd061
Showing
1 changed file
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
}) |