From 4edb1134600c2c62f03e48dfcd131cafc07e3df0 Mon Sep 17 00:00:00 2001 From: Tim Wojtulewicz Date: Thu, 5 Jan 2023 12:07:11 -0700 Subject: [PATCH] Add pre-commit hook for trailing-whitespace --- .pre-commit-config.yaml | 6 ++++++ ConfigurePackaging.cmake | 2 +- FindBIND.cmake | 2 +- FindBISON.cmake | 10 +++++----- FindGooglePerftools.cmake | 2 +- FindRequiredPackage.cmake | 2 +- MAC_PACKAGE_INTRO | 2 +- 7 files changed, 16 insertions(+), 10 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3f5bd37..97e53e7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,6 +2,12 @@ # See https://pre-commit.com/hooks.html for more hooks # repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.4.0 + hooks: + - id: trailing-whitespace + exclude: '^(FindOpenSSL|conan).cmake$' + - repo: https://github.com/maxwinterstein/shfmt-py rev: 3.3.1.8 hooks: diff --git a/ConfigurePackaging.cmake b/ConfigurePackaging.cmake index 4ec60a4..23d924d 100644 --- a/ConfigurePackaging.cmake +++ b/ConfigurePackaging.cmake @@ -58,7 +58,7 @@ macro(SetPackageVersion _version) endmacro(SetPackageVersion) # Sets the list of desired package types to be created by the make -# package target. A .tar.gz is only made for source packages, and +# package target. A .tar.gz is only made for source packages, and # binary pacakage format depends on the operating system: # # Darwin - PackageMaker diff --git a/FindBIND.cmake b/FindBIND.cmake index a5e3204..fff6431 100644 --- a/FindBIND.cmake +++ b/FindBIND.cmake @@ -14,7 +14,7 @@ # Variables defined by this module: # # BIND_FOUND System has BIND, include and library dirs found -# BIND_INCLUDE_DIR The BIND include directories. +# BIND_INCLUDE_DIR The BIND include directories. # BIND_LIBRARY The BIND library (if any) required for # ns_inittab and res_mkquery symbols diff --git a/FindBISON.cmake b/FindBISON.cmake index 0594cdb..0c42989 100644 --- a/FindBISON.cmake +++ b/FindBISON.cmake @@ -150,7 +150,7 @@ IF(BISON_EXECUTABLE) IF("${ARGV5}" STREQUAL "VERBOSE") BISON_TARGET_option_verbose(${Name} ${BisonOutput} "${ARGV6}") ENDIF() - + IF("${ARGV5}" STREQUAL "COMPILE_FLAGS") BISON_TARGET_option_extraopts("${ARGV6}") ENDIF() @@ -164,7 +164,7 @@ IF(BISON_EXECUTABLE) IF("${ARGV7}" STREQUAL "VERBOSE") BISON_TARGET_option_verbose(${Name} ${BisonOutput} "${ARGV8}") ENDIF() - + IF("${ARGV7}" STREQUAL "COMPILE_FLAGS") BISON_TARGET_option_extraopts("${ARGV8}") ENDIF() @@ -184,12 +184,12 @@ IF(BISON_EXECUTABLE) LIST(APPEND BISON_TARGET_cmdopt "-d") STRING(REGEX REPLACE "^(.*)(\\.[^.]*)$" "\\2" _fileext "${ARGV2}") STRING(REPLACE "c" "h" _fileext ${_fileext}) - STRING(REGEX REPLACE "^(.*)(\\.[^.]*)$" "\\1${_fileext}" + STRING(REGEX REPLACE "^(.*)(\\.[^.]*)$" "\\1${_fileext}" BISON_${Name}_OUTPUT_HEADER "${ARGV2}") ENDIF() LIST(APPEND BISON_TARGET_outputs "${BISON_${Name}_OUTPUT_HEADER}") - + ADD_CUSTOM_COMMAND(OUTPUT ${BISON_TARGET_outputs} ${BISON_TARGET_extraoutputs} COMMAND ${BISON_EXECUTABLE} @@ -197,7 +197,7 @@ IF(BISON_EXECUTABLE) DEPENDS ${ARGV1} COMMENT "[BISON][${Name}] Building parser with bison ${BISON_VERSION}" WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) - + # define target variables SET(BISON_${Name}_DEFINED TRUE) SET(BISON_${Name}_INPUT ${ARGV1}) diff --git a/FindGooglePerftools.cmake b/FindGooglePerftools.cmake index 3d16365..b4b4f7f 100644 --- a/FindGooglePerftools.cmake +++ b/FindGooglePerftools.cmake @@ -8,7 +8,7 @@ # to be set before calling find_package: # # GooglePerftools_ROOT_DIR Set this variable to the root installation of -# GooglePerftools if the module has problems finding +# GooglePerftools if the module has problems finding # the proper installation path. # # Variables defined by this module: diff --git a/FindRequiredPackage.cmake b/FindRequiredPackage.cmake index e5d4f14..a233ed8 100644 --- a/FindRequiredPackage.cmake +++ b/FindRequiredPackage.cmake @@ -8,7 +8,7 @@ # # The caller can use these variables to display a list of any missing # packages and abort the build/configuration if there were any. -# +# # Use as follows: # # include(FindRequiredPackage) diff --git a/MAC_PACKAGE_INTRO b/MAC_PACKAGE_INTRO index ef37e62..fd4a1ad 100644 --- a/MAC_PACKAGE_INTRO +++ b/MAC_PACKAGE_INTRO @@ -9,7 +9,7 @@ You may choose to update your PATH environment variable: # For CSH setenv PATH @CMAKE_INSTALL_PREFIX@/bin:$PATH - + If you have more than one volume, please choose the install destination as the one that contains the root filesystem.