Skip to content

Instantly share code, notes, and snippets.

@joelittlejohn
Last active November 6, 2020 16:56
Show Gist options
  • Save joelittlejohn/4729776 to your computer and use it in GitHub Desktop.
Save joelittlejohn/4729776 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$"
Copy link

ghost commented Apr 13, 2016

nice one :D it's pretty neat

@mrmemes-eth
Copy link

Wonderful :) Just what I was looking for. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment