Created
June 3, 2021 09:14
-
-
Save smit9612/02f0c9961ffdcf63c29dd610840c239f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| git diff --cached --name-only | grep "\.swift" | while read filename; do | |
| if which swiftlint >/dev/null; then | |
| swiftlint lint --path "$filename"; | |
| else | |
| echo "warning: SwiftLint not installed, download from https://github.com/ realm/SwiftLint" | |
| fi | |
| done | |
| git-format-staged --formatter "swiftformat stdin --stdinpath '{}'" "*.swift" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.