File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments