Last active
          June 3, 2025 13:36 
        
      - 
      
- 
        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
  
        
  
    
      This file contains hidden or 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
    
  
  
    
  | #!/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$" | 
Wonderful :) Just what I was looking for. Thank you!
Nice
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
            
nice one :D it's pretty neat