homebrew-core/Formula/swiftlint.rb
2019-12-03 20:33:05 -05:00

29 lines
1.1 KiB
Ruby

class Swiftlint < Formula
desc "Tool to enforce Swift style and conventions"
homepage "https://github.com/realm/SwiftLint"
url "https://github.com/realm/SwiftLint.git",
:tag => "0.38.0",
:revision => "8dc3e811934704a3d0e46a8ffd1de785fddcf7ec"
head "https://github.com/realm/SwiftLint.git"
bottle do
cellar :any_skip_relocation
sha256 "a2b39e51661fc24d201788391ce4f9c68007c818857f423161b37bc51f7fcb0b" => :catalina
sha256 "f8ae3a1cb06e0ff8034047a1a5e552ba36d475c6995ca11cd5449da84b98319f" => :mojave
end
depends_on :xcode => ["10.2", :build]
depends_on :xcode => "8.0"
def install
system "make", "prefix_install", "PREFIX=#{prefix}", "TEMPORARY_FOLDER=#{buildpath}/SwiftLint.dst"
end
test do
(testpath/"Test.swift").write "import Foundation"
assert_match "Test.swift:1:1: warning: Trailing Newline Violation: Files should have a single trailing newline. (trailing_newline)",
shell_output("SWIFTLINT_SWIFT_VERSION=3 SWIFTLINT_DISABLE_SOURCEKIT=1 #{bin}/swiftlint lint --no-cache").chomp
assert_match version.to_s,
shell_output("#{bin}/swiftlint version").chomp
end
end