Skip to content

Commit

Permalink
Add CMake formatting to pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jwallwork23 committed Dec 10, 2024
1 parent ebf1c1c commit 1a1e077
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ for FILE in $(git diff --cached --name-only | grep -iE '\.(cpp|cc|h|hpp)$'); do
sed -i~ "s/${LINE}/${NEWLINE}/" ${FILE}
done

# Apply cmake-lint for linting
for FILE in $(git diff --cached --name-only | grep -i 'CMakeLists.txt'); do
cmake-lint ${FILE} --disabled {C0103,C0113} --line-width 100
done

# Abort commit if formatting was applied
AFTER=$(mktemp)
git diff >${AFTER}
Expand Down

0 comments on commit 1a1e077

Please sign in to comment.