Skip to content

Commit

Permalink
Add pre-commit hook for trailing-whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
timwoj committed May 4, 2023
1 parent d441af9 commit 4edb113
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 10 deletions.
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion ConfigurePackaging.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion FindBIND.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
10 changes: 5 additions & 5 deletions FindBISON.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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()
Expand All @@ -184,20 +184,20 @@ 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}
ARGS ${BISON_TARGET_cmdopt} -o ${ARGV2} ${ARGV1}
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})
Expand Down
2 changes: 1 addition & 1 deletion FindGooglePerftools.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion FindRequiredPackage.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion MAC_PACKAGE_INTRO
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down

0 comments on commit 4edb113

Please sign in to comment.