From 5815a9b80c78b95bd48132d63ad4269ee1f79f86 Mon Sep 17 00:00:00 2001 From: leegeth <51681119+leegeth@users.noreply.github.com> Date: Thu, 8 Apr 2021 16:08:28 -0700 Subject: [PATCH] Ignore symlinks from spell checks (#20) --- spellings/tools/find-unknown-comment-words | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/spellings/tools/find-unknown-comment-words b/spellings/tools/find-unknown-comment-words index b39e7f4b..b3fff3e2 100755 --- a/spellings/tools/find-unknown-comment-words +++ b/spellings/tools/find-unknown-comment-words @@ -83,7 +83,8 @@ fi TMPFILE=${0##*/}-$USER-$RANDOM unknowns=( "not-used" ) # get around empty array with nounset -extract-comments `find $DIRNAME \( -iname \*.[ch] -o -iname \*.dox \)` | +# Symlinks will be ignored in this spell check. `-type f` switch in `find` command will ignore symlinks. +extract-comments `find $DIRNAME \( -iname \*.[ch] -o -iname \*.dox \) -type f` | tr [:upper:] [:lower:] | grep -o -E '[a-zA-Z]+' | ablexicon -l $LEXICON > $TMPFILE @@ -103,7 +104,8 @@ do continue fi - for file in `find $DIRNAME \( -iname \*.[ch] -o -iname \*.dox \)` + # Symlinks will be ignored in this spell check. `-type f` switch in `find` command will ignore symlinks. + for file in `find $DIRNAME \( -iname \*.[ch] -o -iname \*.dox \) -type f` do if [[ $file == *"third_party"* || $file == *"CMock"* ]] then