homebrew-core/Formula/swiftlint.rb
2017-03-23 23:28:59 +01: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.17.0",
:revision => "cc9e81754f2ef156c832b1f322d3482765ee0e03"
head "https://github.com/realm/SwiftLint.git"
bottle do
cellar :any_skip_relocation
sha256 "fbc5fa00c055f26e38f22ad6c9d140031c27d4880ade0c14b09cd3560670ce3d" => :sierra
sha256 "35cb91b85781fcc61df16c03d60f9eb929592071e7d359fb70249fecc92430a7" => :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