Skip to content

Commit

Permalink
Use config file and force-exclude flag for typos in the git hook
Browse files Browse the repository at this point in the history
  • Loading branch information
holke committed Oct 15, 2024
1 parent e37e4f0 commit 06d138f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 0 additions & 2 deletions .typos.toml
Original file line number Diff line number Diff line change
@@ -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"]
2 changes: 2 additions & 0 deletions cmake/FindOpenCASCADE.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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 )

Expand Down
7 changes: 6 additions & 1 deletion scripts/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 06d138f

Please sign in to comment.