From e37e4f03b0ea54373ab6ffa6b92c1b0eae6a7f19 Mon Sep 17 00:00:00 2001 From: Johannes Holke Date: Mon, 14 Oct 2024 16:29:49 +0200 Subject: [PATCH 1/3] add oce to typos file --- .typos.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.typos.toml b/.typos.toml index 6ed99410d9..039da29235 100644 --- a/.typos.toml +++ b/.typos.toml @@ -1,6 +1,8 @@ [default.extend-words] eles = "eles" packageid = "packageid" +oce = "oce" + [files] extend-exclude = ["scripts/t8indent", "thirdparty/", "t8code_logo.png", "cmake/FindOpenCASCADE.cmake"] From 06d138f888edb3b7548ff3d7976eeb17316851b5 Mon Sep 17 00:00:00 2001 From: Johannes Holke Date: Tue, 15 Oct 2024 13:43:01 +0200 Subject: [PATCH 2/3] Use config file and force-exclude flag for typos in the git hook --- .typos.toml | 2 -- cmake/FindOpenCASCADE.cmake | 2 ++ scripts/pre-commit | 7 ++++++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.typos.toml b/.typos.toml index 039da29235..6ed99410d9 100644 --- a/.typos.toml +++ b/.typos.toml @@ -1,8 +1,6 @@ [default.extend-words] eles = "eles" packageid = "packageid" -oce = "oce" - [files] extend-exclude = ["scripts/t8indent", "thirdparty/", "t8code_logo.png", "cmake/FindOpenCASCADE.cmake"] diff --git a/cmake/FindOpenCASCADE.cmake b/cmake/FindOpenCASCADE.cmake index 6eb5c10c22..0704e68239 100644 --- a/cmake/FindOpenCASCADE.cmake +++ b/cmake/FindOpenCASCADE.cmake @@ -11,6 +11,8 @@ # OpenCASCADE_LIBRARIES - names of OCC libraries # OpenCASCADE_LINK_DIRECTORY - location of OCC libraries +# test + # ${OpenCASCADE_FOUND} is cached, so once OCC is found this block shouldn't have to run again IF( NOT OpenCASCADE_FOUND ) diff --git a/scripts/pre-commit b/scripts/pre-commit index 4365a7fccf..63430b9282 100755 --- a/scripts/pre-commit +++ b/scripts/pre-commit @@ -35,6 +35,7 @@ CHECK_INDENT=./scripts/check_if_file_indented.scp TYPOS=`which typos 2> /dev/null` +TYPOS_CONFIG_FILE=./.typos.toml if [ -z "$TYPOS" ] then @@ -68,7 +69,11 @@ do continue fi - status=`$TYPOS $file` + # Calling the typos script + # We use a config file to exclude certain spellings and specific files. + # Excluding specific files in the config files does only work when used together + # with --force-exclude + status=`$TYPOS --force-exclude --config $TYPOS_CONFIG_FILE $file` if ! [ -z "$status" ]; then echo "File $file contains typos." nocontinue=1 From 2191d359d070a6e70146e9ca2e66a2a5d45ac1c0 Mon Sep 17 00:00:00 2001 From: Johannes Holke Date: Tue, 15 Oct 2024 13:59:50 +0200 Subject: [PATCH 3/3] Update cmake/FindOpenCASCADE.cmake --- cmake/FindOpenCASCADE.cmake | 2 -- 1 file changed, 2 deletions(-) diff --git a/cmake/FindOpenCASCADE.cmake b/cmake/FindOpenCASCADE.cmake index 0704e68239..6eb5c10c22 100644 --- a/cmake/FindOpenCASCADE.cmake +++ b/cmake/FindOpenCASCADE.cmake @@ -11,8 +11,6 @@ # OpenCASCADE_LIBRARIES - names of OCC libraries # OpenCASCADE_LINK_DIRECTORY - location of OCC libraries -# test - # ${OpenCASCADE_FOUND} is cached, so once OCC is found this block shouldn't have to run again IF( NOT OpenCASCADE_FOUND )