class Swiftformat < Formula desc "Formatting tool for reformatting Swift code" homepage "https://github.com/nicklockwood/SwiftFormat" url "https://github.com/nicklockwood/SwiftFormat/archive/0.33.5.tar.gz" sha256 "a03170a909e77c78c8ca835defe26a687381ea86c4992b8cc227a27dc99ac68d" head "https://github.com/nicklockwood/SwiftFormat.git", :shallow => false bottle do cellar :any_skip_relocation sha256 "935ca22d3c988cc433f16c0d77e171fbdf11bf08ca7939f8696b68e0e6975360" => :high_sierra sha256 "1063c03a9966b89926b50cd6a9a2693af4da36414548219be7b330cc4a69c200" => :sierra end depends_on :xcode => ["9.0", :build] def install xcodebuild "-project", "SwiftFormat.xcodeproj", "-scheme", "SwiftFormat (Command Line Tool)", "CODE_SIGN_IDENTITY=", "SYMROOT=build", "OBJROOT=build" bin.install "build/Release/swiftformat" end test do (testpath/"potato.swift").write <<~EOS struct Potato { let baked: Bool } EOS system "#{bin}/swiftformat", "#{testpath}/potato.swift" end end