Skip to content

Commit

Permalink
Fix trailing space checker to remove existing trailing spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
ksco committed Mar 31, 2024
1 parent b9a0ba0 commit 16934af
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions suite/runsuite.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,12 @@ endif ()
# to get the diff and check it. The vera++ rules do check C/C++ code.

# Check for trailing space. This is a diff with an initial column for +-,
# so a blank line will have one space: thus we rule that out.
# so we need to exclude the following cases:
# 1. existing blank line will now have one space;
# 2. lines starting with -.
# We do this by matching lines that start with + or a space and end with a space.
# The clang-format check will now find these in C files, but not non-C files.
string(REGEX MATCH "[^\n] \n" match "${diff_contents}")
string(REGEX MATCH "^[+ ].* \n" match "${diff_contents}")
if (NOT "${match}" STREQUAL "")
# Get more context
string(REGEX MATCH "\n[^\n]+ \n" match "${diff_contents}")
Expand Down
2 changes: 1 addition & 1 deletion suite/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4277,7 +4277,7 @@ if (BUILD_CLIENTS)
if (DR_HOST_X86 AND DR_HOST_X64 AND LINUX)
torunonly_drcacheoff(opcode_categories allasm_x86_64 ""
"@-simulator_type@opcode_mix" "")

# Requires sudo to access pagemap.
# XXX: Should we not enable this outside of the Github suite where we know
# we have passwordless sudo? The pause for a password may cause problems
Expand Down

0 comments on commit 16934af

Please sign in to comment.