start a list of file patterns to ignore

This commit is contained in:
burnettk 2023-04-28 22:48:02 -04:00
parent 247c260541
commit 1ea36658cc
1 changed files with 4 additions and 2 deletions

View File

@ -16,6 +16,8 @@ fi
list_of_unused_things="$(dead | grep -E '^[a-z].*is never read')"
filename_patterns_to_ignore="(codemod|migrations/versions|conftest.py|noxfile.py)"
while read -r line; do
function_name="$(echo "$line" | awk '{print $1}')"
echo "possible function_name: ${function_name}"
@ -25,8 +27,8 @@ while read -r line; do
echo "skipping $function_name in ${file_name} because it's not a function"
continue
fi
if grep -E codemod <<< "$file_name" >/dev/null 2>&1; then
echo "skipping ${file_name} because it's a codemod file"
if grep -E "$filename_patterns_to_ignore" <<< "$file_name" >/dev/null 2>&1; then
echo "skipping ${file_name} because it's in the list of files to ignore (probably because it is a false positive and actually used)"
continue
fi
echo "trying to remove $function_name from: ${file_name}"