Skip to content

Instantly share code, notes, and snippets.

@acoomans
Last active March 29, 2026 01:49
Show Gist options
  • Select an option

  • Save acoomans/e25328401979b0c18c1ff192e32f285f to your computer and use it in GitHub Desktop.

Select an option

Save acoomans/e25328401979b0c18c1ff192e32f285f to your computer and use it in GitHub Desktop.
Swift pre-commit hook
#!/bin/zsh
export PATH=/usr/local/bin:$PATH
# Copy this script to "~/.git/hooks/pre-commit" to run swiftformat & swiftlint verification before a commit
/usr/local/bin/swiftformat .
/usr/local/bin/swiftlint lint --quiet .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment