Last active
August 13, 2019 14:47
-
-
Save samdoran/a63e8e3cc0f1fc9a898f0160fdd6e307 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require "language/haskell" | |
| class Shellcheck < Formula | |
| include Language::Haskell::Cabal | |
| desc "Static analysis and lint tool, for (ba)sh scripts" | |
| homepage "https://www.shellcheck.net/" | |
| url "https://github.com/koalaman/shellcheck/archive/v0.4.6.tar.gz" | |
| sha256 "1c3cd8995ebebf6c8e5475910809762b91bebf0a3827ad87a0c392c168326de2" | |
| head "https://github.com/koalaman/shellcheck.git" | |
| depends_on "cabal-install" => :build | |
| depends_on "ghc" => :build | |
| depends_on "pandoc" => :build | |
| def install | |
| install_cabal_package | |
| system "pandoc", "-s", "-f", "markdown-smart", "-t", "man", | |
| "shellcheck.1.md", "-o", "shellcheck.1" | |
| man1.install "shellcheck.1" | |
| end | |
| test do | |
| sh = testpath/"test.sh" | |
| sh.write <<~EOS | |
| for f in $(ls *.wav) | |
| do | |
| echo "$f" | |
| done | |
| EOS | |
| assert_match "[SC2045]", shell_output("#{bin}/shellcheck -f gcc #{sh}", 1) | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment