Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properly exclude files with typos in pre-commit hook #1270

Merged
merged 3 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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

holke marked this conversation as resolved.
Show resolved Hide resolved
# ${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