2019-11-20 14:29:36 +00:00
|
|
|
class Detekt < Formula
|
|
|
|
desc "Static code analysis for Kotlin"
|
|
|
|
homepage "https://github.com/arturbosch/detekt"
|
2019-12-28 12:12:07 +00:00
|
|
|
url "https://jcenter.bintray.com/io/gitlab/arturbosch/detekt/detekt-cli/1.3.0/detekt-cli-1.3.0-all.jar"
|
|
|
|
sha256 "610b0211b909d8e79c1b623119e1d94cb833a8e98b32e5a0e991fa2d214992f6"
|
2019-11-20 14:29:36 +00:00
|
|
|
|
2019-12-17 22:37:31 +00:00
|
|
|
bottle :unneeded
|
2019-12-10 03:57:46 +00:00
|
|
|
|
2019-11-20 14:29:36 +00:00
|
|
|
depends_on :java => "1.8+"
|
|
|
|
|
|
|
|
def install
|
2019-11-26 23:02:27 +00:00
|
|
|
libexec.install "detekt-cli-#{version}-all.jar"
|
|
|
|
bin.write_jar_script libexec/"detekt-cli-#{version}-all.jar", "detekt"
|
2019-11-20 14:29:36 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
2019-11-26 14:22:37 +00:00
|
|
|
(testpath/"input.kt").write <<~EOS
|
|
|
|
fun main() {
|
|
|
|
|
|
|
|
}
|
|
|
|
EOS
|
|
|
|
system bin/"detekt", "--input", "input.kt", "--report", "txt:output.txt"
|
|
|
|
assert_equal "EmptyFunctionBlock", shell_output("cat output.txt").slice(/\w+/)
|
2019-11-20 14:29:36 +00:00
|
|
|
end
|
|
|
|
end
|