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.20.1",
|
|
:revision => "d8f5a316f29077cd22f7d129e8bfaf4f4238d6f1"
|
|
head "https://github.com/realm/SwiftLint.git"
|
|
|
|
bottle do
|
|
cellar :any
|
|
sha256 "6f7414d4065c79eeedf4e1bdf54c932256d2353a8b5b767a3cf05444dd59432b" => :sierra
|
|
sha256 "17da84902560bb1d7e936c5ea3d6618e38b3995b9185d1c06c09d0775d0967e8" => :el_capitan
|
|
end
|
|
|
|
depends_on :xcode => ["7.0", :run]
|
|
depends_on :xcode => ["8.0", :build]
|
|
|
|
def install
|
|
system "make", "prefix_install", "PREFIX=#{prefix}", "TEMPORARY_FOLDER=#{buildpath}/SwiftLint.dst"
|
|
end
|
|
|
|
test do
|
|
(testpath/"Test.swift").write "import Foundation"
|
|
assert_match "#{testpath}/Test.swift:1: warning: Trailing Newline Violation: Files should have a single trailing newline. (trailing_newline)",
|
|
shell_output("SWIFTLINT_SWIFT_VERSION=3 #{bin}/swiftlint").chomp
|
|
assert_match version.to_s,
|
|
shell_output("#{bin}/swiftlint version").chomp
|
|
end
|
|
end
|