I recommend to use SwiftFormat.
https://github.com/nicklockwood/SwiftFormat
- Make a bash file that runs swiftFormat
echo ""
__system "Run swiftformat.."
Pods/SwiftFormat/CommandLineTool/swiftformat -c .swiftformat .
__system "Done"
2. add bash file command to the pre-commit hook.
./chore.bash