homebrew-core/Formula/flow.rb
ilovezfs c4e156d7b2 flow: revision for ocaml
apply upstream commit adding compatibility for OCaml 4.04.0 as a patch
2016-11-30 16:54:15 -08:00

46 lines
1.5 KiB
Ruby

class Flow < Formula
desc "Static type checker for JavaScript"
homepage "https://flowtype.org/"
revision 1
head "https://github.com/facebook/flow.git"
stable do
url "https://github.com/facebook/flow/archive/v0.36.0.tar.gz"
sha256 "064792468e9b811fbc8d030de18b5b296b6214b2429e6c40876a64262e65fb16"
# OCaml 4.04.0 compatibility
# Upstream commit from 22 Nov 2016 "Remove unused modules"
patch do
url "https://github.com/facebook/flow/commit/2edc619.patch"
sha256 "6cc507f72850e1ef921e7db2e9ac5a036851f23eca00c00a14c9bfbb77b5eb1c"
end
end
bottle do
cellar :any_skip_relocation
sha256 "e3b1c08c1758d0476596e0b7337bba58be075856b440fcf37c5eb0b4ae4897c5" => :sierra
sha256 "f10d2ba2f8efbf505daf76a84701a069293e5a13d183caaa235cb8431a1c49fc" => :el_capitan
sha256 "092d894c008f4fbc1f8157208c87eedd88b8d1cf3d3c619755915b82032165d8" => :yosemite
end
depends_on "ocaml" => :build
depends_on "ocamlbuild" => :build
def install
system "make"
bin.install "bin/flow"
bash_completion.install "resources/shell/bash-completion" => "flow-completion.bash"
zsh_completion.install_symlink bash_completion/"flow-completion.bash" => "_flow"
end
test do
system "#{bin}/flow", "init", testpath
(testpath/"test.js").write <<-EOS.undent
/* @flow */
var x: string = 123;
EOS
expected = /Found 1 error/
assert_match expected, shell_output("#{bin}/flow check #{testpath}", 2)
end
end