homebrew-core/Formula/ktlint.rb

24 lines
600 B
Ruby
Raw Normal View History

2019-04-24 09:23:30 +00:00
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.32.0/ktlint"
sha256 "95d292cb45271c733640a3d24add7db4f9f2fac998fb5a15679e6da79fb04441"
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