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

Commit

Permalink
feat: add alejandra formatter for nix (#817)
Browse files Browse the repository at this point in the history
* feat: add `alejandra` formatter for `nix`

* add `--quiet` argument to `alejandra` formatter

Co-authored-by: Jose Alvarez <j.alvarez11@icloud.com>
  • Loading branch information
marcelarie and Jose Alvarez authored Apr 22, 2022
1 parent 4d97ea7 commit 523d8dd
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions lua/null-ls/builtins/formatting/alejandra.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
local h = require("null-ls.helpers")
local methods = require("null-ls.methods")

local FORMATTING = methods.internal.FORMATTING

return h.make_builtin({
name = "alejandra",
meta = {
url = "https://github.com/kamadorueda/alejandra",
description = "The Uncompromising Nix Code Formatter",
},
method = FORMATTING,
filetypes = { "nix" },
generator_opts = {
command = "alejandra",
args = { "--quiet" },
to_stdin = true,
},
factory = h.formatter_factory,
})

0 comments on commit 523d8dd

Please sign in to comment.