920c1a4ee2
Closes #42329. Signed-off-by: Chongyu Zhu <i@lembacon.com>
23 lines
600 B
Ruby
23 lines
600 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.34.2/ktlint"
|
|
sha256 "62f1123496548dbc5407da594823b475352043b49d29a925445ae8a690273aec"
|
|
|
|
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
|