https://github.com/binarybirds/swift-format-template
https://github.com/binarybirds/swift-format-template
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/binarybirds/swift-format-template
- Owner: BinaryBirds
- Created: 2023-04-15T11:26:16.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-10-21T20:35:27.000Z (over 2 years ago)
- Last Synced: 2025-03-19T13:17:13.337Z (about 1 year ago)
- Language: Makefile
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Swift format template
Install [swift-format](https://github.com/apple/swift-format):
```shell
brew install swift-format
```
Create a `.swift-format` using this template.
```shell
curl -s https://raw.githubusercontent.com/BinaryBirds/swift-format-template/main/.swift-format > .swift-format
```
Add these lines to your `Makefile`:
```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:
```shell
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:
```shell
make format
make lint
```
That's it.