Created
July 23, 2023 13:13
-
-
Save dimohamdy/c41c766a8c26afdf4b822364ccbe0877 to your computer and use it in GitHub Desktop.
List unused code using periphery
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "🔍 Start dead code analysis" | |
result="$(periphery scan --config .periphery.yml)" | |
current_dir=$(pwd) | |
result_stripped_of_absolute_path_prefix=$(echo "$result" | sed "s|$current_dir/||g") | |
filtered_out_result=$(echo "$result_stripped_of_absolute_path_prefix" | awk '/:[0-9]+:[0-9]+:/{ print }') | |
sorted_result=$(echo "$filtered_out_result" | sort) | |
echo "🙌 Done with dead code analysis" | |
echo "$sorted_result" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment