From 5a445c608ff4b00bb190799af2843e80ef2bbf90 Mon Sep 17 00:00:00 2001 From: Matt Traudt Date: Tue, 19 Jun 2018 12:01:03 -0400 Subject: [PATCH] Add find-dead-funcs maint script GH: ref #143 --- CHANGELOG.md | 5 +++ scripts/maint/find-dead-funcs | 81 +++++++++++++++++++++++++++++++++++ 2 files changed, 86 insertions(+) create mode 100755 scripts/maint/find-dead-funcs diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e409656..18708da9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +### Added + +- Maintenance script to help us find functions that are (probably) no longer + being called. + ### Changed - Change the path where the Bandwidth List files are generated: now they are diff --git a/scripts/maint/find-dead-funcs b/scripts/maint/find-dead-funcs new file mode 100755 index 00000000..aa81d68b --- /dev/null +++ b/scripts/maint/find-dead-funcs @@ -0,0 +1,81 @@ +#!/usr/bin/env bash + +SOURCE_DIR=sbws +TESTS_DIR=tests + +UNUSED_LOG=unused-funcs.txt +USED_LOG=used-funcs.txt + +cat > $USED_LOG <> $UNUSED_LOG + else + echo "$FUNC" >> $USED_LOG + echo "$USAGE_INFO" >> $USED_LOG + fi + done +} + +echo "Writing unused function names to $UNUSED_LOG" +echo "Writing used function names and information to $USED_LOG" + +get_all_funcs | get_func_usage_count