Merge pull request #257 from hatal175/newline

This commit is contained in:
notyourav 2022-01-08 21:46:07 -08:00 committed by GitHub
commit 96dfb8138e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -26,5 +26,7 @@ echo "Running clang-tidy..."
clang-tidy ${TIDY_OPTS} src/**/*.c -- ${COMPILER_OPTS} &> /dev/null
clang-tidy ${TIDY_OPTS} include/**/*.h -- ${COMPILER_OPTS} &> /dev/null
echo "Adding missing final new lines..."
find src/ -type f -name "*.c" -exec sed -i -e '$a\' {} \;
# only run sed if no new line at the end of file so we don't unnecessarily touch the file.
find src/ -type f -name "*.c" -exec bash -c 'if [[ -n "$(tail -c 1 {})" ]]; then sed -i -e '"'"'$a\'"'"' {}; fi' \;
echo "Done formatting all files."