Skip to content

Instantly share code, notes, and snippets.

@Leocardoso94
Forked from joelittlejohn/find-unused-clj.sh
Created April 10, 2019 12:27
Show Gist options
  • Select an option

  • Save Leocardoso94/5ef1a741072a77b9b2dd65193901adad to your computer and use it in GitHub Desktop.

Select an option

Save Leocardoso94/5ef1a741072a77b9b2dd65193901adad to your computer and use it in GitHub Desktop.
Very quick and dirty command to find unused functions and vars in a Clojure project
#!/bin/bash
for f in $(egrep -o -R "defn?-? [^ ]*" * --include '*.clj*' | cut -d \ -f 2 | sort | uniq); do
echo $f $(grep -R --include '*.clj*' -- "$f" * | wc -l);
done | grep " 1$"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment