Created
January 25, 2020 19:04
-
-
Save thedch/e8637a0f9b3ff0fce47088b3ce2e8262 to your computer and use it in GitHub Desktop.
A bunch of greps strung together to find unused classes in Python. May have bugs.
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
#!/bin/bash | |
# there's probably (definitely?) a better way to do this, but it seems to work. | |
classes=$(grep -oEh "^class \w+[\(:]" * | cut -c 7- | sed 's/.\{1\}$//') | |
for c in $classes ; do | |
grep $c * | grep -vq "class" || echo $c | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment