-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
22 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
# Redirect output to stderr. | ||
|
||
exec 1>&2 | ||
|
||
# Don't allow non-ASCII characters in filenames. | ||
|
||
if test $(git diff --cached --name-only --diff-filter=A -z HEAD | LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0; then | ||
echo "Tryna add non-ASCII filenames" | ||
exit 1 | ||
fi | ||
|
||
# If there are terminating whitespaces, print the offending file names and fail. | ||
|
||
git diff-index --check --cached HEAD -- | ||
|
||
# Run `clang-format` and fail if it fails. | ||
|
||
exec find . -name "*.[ch]" | xargs clang-format18 -i |
This file contains 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