Skip to content

Commit bd4ae23

Browse files
committed
alejandra 4.0.0 (new formula)
Adds a new formular for Alejandra, a code formatter for Nix files
1 parent 119ba12 commit bd4ae23

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

Formula/a/alejandra.rb

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
class Alejandra < Formula
2+
desc "Command-line tool for formatting Nix Code"
3+
homepage "https://kamadorueda.com/alejandra/"
4+
url "https://github.com/kamadorueda/alejandra/archive/refs/tags/4.0.0.tar.gz"
5+
sha256 "f3f9989c3fb6a56e2050bf5329692fae32a2b54be7c0652aa394afe4660ebb74"
6+
license "Unlicense"
7+
head "https://github.com/kamadorueda/alejandra.git", branch: "main"
8+
9+
depends_on "rust" => :build
10+
11+
def install
12+
system "cargo", "install", *std_cargo_args(path: "src/alejandra_cli")
13+
end
14+
15+
test do
16+
assert_equal "Alejandra #{version}", shell_output("#{bin}/alejandra --version").chomp
17+
18+
ENV["LC_ALL"] = "en_US.UTF-8"
19+
input_nix = "{description=\"Demo\";outputs={self}:{};}"
20+
output_nix = "{\n description = \"Demo\";\n outputs = {self}: {};\n}"
21+
22+
(testpath/"alejandra_test.nix").write input_nix
23+
system bin/"alejandra", "alejandra_test.nix"
24+
assert_equal output_nix, (testpath/"alejandra_test.nix").read.strip
25+
end
26+
end

0 commit comments

Comments
 (0)