aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/shellcheck.rb
blob: 5ab0357380801d4503c9fcc9c6be1bdd1ad2a973 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
require "formula"
require "language/haskell"

class Shellcheck < Formula
  include Language::Haskell::Cabal

  homepage "http://www.shellcheck.net"
  url "https://github.com/koalaman/shellcheck/archive/v0.3.5.tar.gz"
  sha1 "e2907df9a28b955bde122c4ddf144c6039c0b85d"

  bottle do
    sha1 "487e94b0a1efe6953b4eb8163fbe3431f80f526b" => :yosemite
    sha1 "1aa013ebd2eeb72e61f9cde87e41271abe13511e" => :mavericks
    sha1 "af81f345a1ad58bdf1c7a742a945aba9eb3819ed" => :mountain_lion
  end

  depends_on "ghc" => :build
  depends_on "cabal-install" => :build
  depends_on "pandoc" => :build
  depends_on "gmp"

  def install
    install_cabal_package
    system "pandoc", "-s", "-t", "man", "shellcheck.1.md", "-o", "shellcheck.1"
    man1.install "shellcheck.1"
  end

  test do
    sh = testpath/"test.sh"
    sh.write <<-EOS.undent
      for f in $(ls *.wav)
      do
        echo "$f"
      done
    EOS
    assert `shellcheck -f gcc #{sh}`.include? "[SC2045]"
  end
end