25 lines
616 B
Ruby
25 lines
616 B
Ruby
class Ktlint < Formula
|
|
desc "Anti-bikeshedding Kotlin linter with built-in formatter"
|
|
homepage "https://ktlint.github.io/"
|
|
url "https://github.com/pinterest/ktlint/releases/download/0.38.1/ktlint"
|
|
sha256 "b2edfe77a797fe26fef53da455eb631db32b4294aaab9f45bf5de23d631ae873"
|
|
license "MIT"
|
|
|
|
bottle :unneeded
|
|
|
|
def install
|
|
bin.install "ktlint"
|
|
end
|
|
|
|
test do
|
|
(testpath/"In.kt").write <<~EOS
|
|
fun main( )
|
|
EOS
|
|
(testpath/"Out.kt").write <<~EOS
|
|
fun main()
|
|
EOS
|
|
system bin/"ktlint", "-F", "In.kt"
|
|
assert_equal shell_output("cat In.kt"), shell_output("cat Out.kt")
|
|
end
|
|
end
|