Swiftformat on githooks + New swift run tools setup command (#563)
This commit is contained in:
8
.githooks/post-checkout
Executable file
8
.githooks/post-checkout
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/bin/sh
|
||||
command -v git-lfs >/dev/null 2>&1 || { echo >&2 "\nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting '.git/hooks/post-checkout'.\n"; exit 2; }
|
||||
git lfs post-checkout "$@"
|
||||
|
||||
#!/bin/bash
|
||||
export PATH="$PATH:/opt/homebrew/bin"
|
||||
|
||||
xcodegen
|
||||
3
.githooks/post-commit
Executable file
3
.githooks/post-commit
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
command -v git-lfs >/dev/null 2>&1 || { echo >&2 "\nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting '.git/hooks/post-commit'.\n"; exit 2; }
|
||||
git lfs post-commit "$@"
|
||||
3
.githooks/post-merge
Executable file
3
.githooks/post-merge
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
command -v git-lfs >/dev/null 2>&1 || { echo >&2 "\nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting '.git/hooks/post-merge'.\n"; exit 2; }
|
||||
git lfs post-merge "$@"
|
||||
10
.githooks/pre-commit
Executable file
10
.githooks/pre-commit
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
export PATH="$PATH:/opt/homebrew/bin"
|
||||
|
||||
if ! swiftformat --lint . > /dev/null 2>&1
|
||||
then
|
||||
echo "pre-commit: Commit aborted due to SwiftFormat warnings. Please check the automatically generated fixes and try again"
|
||||
swiftformat . > /dev/null 2>&1
|
||||
exit 1
|
||||
fi
|
||||
3
.githooks/pre-push
Executable file
3
.githooks/pre-push
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
command -v git-lfs >/dev/null 2>&1 || { echo >&2 "\nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting '.git/hooks/pre-push'.\n"; exit 2; }
|
||||
git lfs pre-push "$@"
|
||||
Reference in New Issue
Block a user