29 lines
1.1 KiB
Ruby
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.29.0",
|
|
:revision => "8fc75e393b91e59699b4e93a068e7e0ca05bab54"
|
|
head "https://github.com/realm/SwiftLint.git"
|
|
|
|
bottle do
|
|
cellar :any_skip_relocation
|
|
sha256 "5d2e49da273783dd33404f7770438cf4fe4276b50cfe8a54445b8a8e4949e68a" => :mojave
|
|
sha256 "1bcb2202ee85a6be2255dbba9c5587e21c6e38257502f1c2cac5f9c68fb31f6f" => :high_sierra
|
|
end
|
|
|
|
depends_on :xcode => ["10.0", :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
|