Skip to content

Commit

Permalink
Merge pull request #1270 from DLR-AMR/feature-properly_exclude_files_…
Browse files Browse the repository at this point in the history
…with_typos

Properly exclude files with typos in pre-commit hook
  • Loading branch information
Davknapp authored Oct 18, 2024
2 parents e11e599 + 2191d35 commit 65bd89f
Showing 1 changed file with 6 additions and 1 deletion.
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 65bd89f

Please sign in to comment.