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