2019-11-20 14:29:36 +00:00
|
|
|
class Detekt < Formula
|
|
|
|
desc "Static code analysis for Kotlin"
|
|
|
|
homepage "https://github.com/arturbosch/detekt"
|
|
|
|
url "https://jcenter.bintray.com/io/gitlab/arturbosch/detekt/detekt-cli/1.1.1/detekt-cli-1.1.1-all.jar"
|
|
|
|
sha256 "8b17c25cd0e9c507773eae0afff97e89c4a1c502b1b1b91c8d55a62032326b3a"
|
|
|
|
|
|
|
|
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
|