Skip to content

Latest commit

 

History

History
39 lines (26 loc) · 808 Bytes

README.md

File metadata and controls

39 lines (26 loc) · 808 Bytes

Swift format template

Install swift-format:

brew install swift-format

Create a .swift-format using this template.

curl -s https://raw.githubusercontent.com/BinaryBirds/swift-format-template/main/.swift-format > .swift-format

Add these lines to your Makefile:

format:
	swift-format -i -r ./Sources && swift-format -i -r ./Tests

lint:
	swift-format lint -r ./Sources && swift-format lint -r ./Tests

One-liner integration:

curl -s https://raw.githubusercontent.com/BinaryBirds/swift-format-template/main/.swift-format > .swift-format && curl -s https://raw.githubusercontent.com/BinaryBirds/swift-format-template/main/Makefile >> ./Makefile

Usage:

make format
make lint

That's it.