Skip to content

Commit 2c28871

Browse files
committed
Revert "cmake format target: add whitespace correction (apache#12696)"
This reverts commit a399830.
1 parent c8cc2f6 commit 2c28871

File tree

3 files changed

+1
-103
lines changed

3 files changed

+1
-103
lines changed

CMakeLists.txt

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -806,18 +806,10 @@ add_custom_target(
806806
VERBATIM
807807
)
808808

809-
add_custom_target(
810-
whitespace-format
811-
${CMAKE_SOURCE_DIR}/tools/whitespace-format.sh
812-
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
813-
COMMENT "fixing whitespace issues (trailing whitespace, DOS line endings)"
814-
VERBATIM
815-
)
816-
817809
# Add a format target that runs all the formatters.
818810
add_custom_target(
819811
format
820-
DEPENDS clang-format yapf cmake-format whitespace-format
812+
DEPENDS clang-format yapf cmake-format
821813
COMMENT "formatting all files"
822814
)
823815

tools/git/pre-commit

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -123,32 +123,6 @@ else
123123
echo
124124
fi
125125

126-
# Check for trailing whitespace in staged files.
127-
TRAILING_WS=$(git diff-index --cached --diff-filter=ACMR --name-only HEAD | grep -vE "lib/(yamlcpp|Catch2|systemtap)" | grep -vE "\.(gold|test_input)$" | xargs git diff --cached | grep -E '^\+.*[[:space:]]$' || true)
128-
if [ -n "$TRAILING_WS" ]; then
129-
echo "The commit is not accepted because it contains trailing whitespace."
130-
echo "The easiest way to fix this is to run:"
131-
echo
132-
echo " $ cmake --build <build_dir> --target format"
133-
exit 1
134-
else
135-
echo "This commit complies with the trailing whitespace rules."
136-
echo
137-
fi
138-
139-
# Check for DOS carriage returns in staged files.
140-
DOS_CR=$(git diff-index --cached --diff-filter=ACMR --name-only HEAD | grep -vE "lib/(yamlcpp|Catch2|systemtap)" | grep -vE "\.test_input$" | xargs git diff --cached | grep -E '^\+.*\r$' || true)
141-
if [ -n "$DOS_CR" ]; then
142-
echo "The commit is not accepted because it contains DOS carriage returns."
143-
echo "The easiest way to fix this is to run:"
144-
echo
145-
echo " $ cmake --build <build_dir> --target format"
146-
exit 1
147-
else
148-
echo "This commit complies with the DOS line ending rules."
149-
echo
150-
fi
151-
152126
# Cleanup before exit
153127
rm -f "$clang_patch_file" "$yapf_patch_file"
154128
exit 0

tools/whitespace-format.sh

Lines changed: 0 additions & 68 deletions
This file was deleted.

0 commit comments

Comments
 (0)