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.25.0", :revision => "c875bed8135517288fd89c072c0a316b4cdedb74" head "https://github.com/realm/SwiftLint.git" bottle do cellar :any_skip_relocation sha256 "3377814fd020c041682b7ada455e7d7e5b0256177980180365dde4ce8819354d" => :high_sierra sha256 "d0cc75d2c8306fb072cdd4d7d0399898496eca82b9231bcff92855b6fc073b44" => :sierra end depends_on :xcode => "8.0" depends_on :xcode => ["9.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