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
Changes from all 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
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
Loading