37 lines
1.2 KiB
Ruby
37 lines
1.2 KiB
Ruby
class Wartremover < Formula
|
|
desc "Flexible Scala code linting tool"
|
|
homepage "https://github.com/wartremover/wartremover"
|
|
url "https://github.com/wartremover/wartremover/archive/v2.4.16.tar.gz"
|
|
sha256 "41e906afe560650130cf14e307b65be0749a85d8435fd2e4d40403a0eb9b56cf"
|
|
license "Apache-2.0"
|
|
head "https://github.com/wartremover/wartremover.git", branch: "master"
|
|
|
|
bottle do
|
|
sha256 cellar: :any_skip_relocation, all: "32f5fefead8cc719ca13583ccf42faf976a33f3b45914767a014d667c167eaf2"
|
|
end
|
|
|
|
depends_on "sbt" => :build
|
|
depends_on arch: :x86_64 # openjdk@8 is not supported on ARM
|
|
depends_on "openjdk@8"
|
|
|
|
def install
|
|
system "sbt", "-sbt-jar", Formula["sbt"].opt_libexec/"bin/sbt-launch.jar",
|
|
"core/assembly"
|
|
libexec.install "wartremover-assembly.jar"
|
|
bin.write_jar_script libexec/"wartremover-assembly.jar", "wartremover", java_version: "1.8"
|
|
end
|
|
|
|
test do
|
|
(testpath/"foo").write <<~EOS
|
|
object Foo {
|
|
def foo() {
|
|
var msg = "Hello World"
|
|
println(msg)
|
|
}
|
|
}
|
|
EOS
|
|
cmd = "#{bin}/wartremover -traverser org.wartremover.warts.Unsafe foo 2>&1"
|
|
assert_match "var is disabled", shell_output(cmd, 1)
|
|
end
|
|
end
|