Skip to content

Commit 73d3dbb

Browse files
committed
hindent 6.2.1 (new formula)
Signed-off-by: botantony <antonsm21@gmail.com>
1 parent d8a0b70 commit 73d3dbb

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

Formula/h/hindent.rb

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
class Hindent < Formula
2+
desc "Haskell pretty printer"
3+
homepage "https://github.com/mihaimaruseac/hindent"
4+
url "https://github.com/mihaimaruseac/hindent/archive/refs/tags/v6.2.1.tar.gz"
5+
sha256 "9f3dcd310b5ef773600551af9eda8db40f69ffd570d8ed474f7b8c2e93cd55ec"
6+
license "BSD-3-Clause"
7+
head "https://github.com/mihaimaruseac/hindent.git", branch: "master"
8+
9+
depends_on "cabal-install" => :build
10+
# TODO: switch to ghc@9.12 in the next release
11+
# https://github.com/mihaimaruseac/hindent/pull/1000
12+
# See GHC 9.14 issue: https://github.com/mihaimaruseac/hindent/issues/1155
13+
depends_on "ghc@9.10" => :build
14+
15+
def install
16+
system "cabal", "v2-update"
17+
system "cabal", "v2-install", *std_cabal_v2_args
18+
end
19+
20+
test do
21+
assert_match version.to_s, shell_output("#{bin}/hindent --version")
22+
23+
(testpath/"Input.hs").write <<~HASKELL
24+
example = case x of Just _ -> "Foo"
25+
HASKELL
26+
(testpath/"Expected.hs").write <<~HASKELL
27+
example =
28+
case x of
29+
Just _ -> "Foo"
30+
HASKELL
31+
32+
assert_equal (testpath/"Expected.hs").read,
33+
pipe_output("#{bin}/hindent --indent-size 2", (testpath/"Input.hs").read, 0)
34+
end
35+
end

0 commit comments

Comments
 (0)