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.36.0",
|
|
:revision => "652e5dd59c44f00ef89549a1d923f2a72378b85f"
|
|
head "https://github.com/realm/SwiftLint.git"
|
|
|
|
bottle do
|
|
cellar :any_skip_relocation
|
|
sha256 "0a5d2d46bb1c9330214543772a4145930ac8923540538a1b21136669cdeb66d4" => :catalina
|
|
sha256 "57a8c20d6df4d6b2dc122efa8489ee5990f9068e34ff97068947299927c70a39" => :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
|