Created
April 20, 2016 14:14
-
-
Save fblundun/efb6b163be9f28083aec32c6f887d94f to your computer and use it in GitHub Desktop.
Write list of filenames and line numbers corresponding to unnecessary import statements
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
for srcf in $(find src/main -name '*.scala'); do for lineno in $(grep -n '^import' $srcf | sed 's/:/ /g' | grep -v '{' | awk '{print $1}'); do echo $srcf $lineno; sed -i "${lineno}d" $srcf; sbt compile;if [ $? -eq 0 ]; then echo $srcf $lineno | tee -a output; fi; git checkout .; done; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment