Skip to content

Commit

Permalink
Prevent trailing space
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmundell committed Nov 13, 2024
1 parent ab8777b commit 463a0f7
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,18 @@ set_target_properties (gvm-pg-server PROPERTIES SOVERSION "${CPACK_PACKAGE_VERSI
set_target_properties (gvm-pg-server PROPERTIES VERSION "${CPACK_PACKAGE_VERSION}")
include_directories (${PostgreSQL_INCLUDE_DIRS} ${PostgreSQL_SERVER_INCLUDE_DIRS})

## Precommit-like checks

if (NOT CMAKE_BUILD_TYPE MATCHES "Release")
add_custom_target(check-whitespace ALL
# once for output
COMMAND grep -Hn "[ ]$$" *.c *.h | sed "'s/^\\(.\\+:.\\+:\\)/\\1 error: trailing space: /'"
# again for exit code
COMMAND ! grep --quiet "[ ]$$" *.c *.h
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT "Checking whitespace...")
endif (NOT CMAKE_BUILD_TYPE MATCHES "Release")

## Program

add_executable (manage-utils-test
Expand Down

0 comments on commit 463a0f7

Please sign in to comment.