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.1",
|
|
:revision => "c3d23ea771dd067519749e870d36c7626e8a0094"
|
|
head "https://github.com/realm/SwiftLint.git"
|
|
|
|
bottle do
|
|
cellar :any_skip_relocation
|
|
sha256 "c40bed444ad3bcf1daa0b5260865de201edde90287f828463d4e2d70ea440269" => :mojave
|
|
sha256 "1776359ce699d02f7a16c2364334f55423209342f2b09a6674dde98a4b1b5dc6" => :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
|