c113a1f202
Closes #40402. 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.33.0/ktlint"
|
|
sha256 "2b8487d635977bd844ea22478c457f008fc6732a4257640de2add5e54f23d087"
|
|
|
|
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
|