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.35.0/ktlint"
|
|
sha256 "f5810d9f80f167032641ca70213c71821add9cf4936f4ee6f116dbab1847417e"
|
|
|
|
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
|