Last active
December 1, 2016 14:10
-
-
Save mp911de/a676680ccfb3a6671c64d6f1d7af699c to your computer and use it in GitHub Desktop.
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 | |
| ################################################################################### | |
| # Run this script in your project. It will process all files below src/test/java. | |
| ################################################################################### | |
| files=$(grep -lR "@see" src/test/java | grep .java$) | |
| for file in $files | |
| do | |
| grep -E "@see [A-Z]+\-[0-9]+" $file \ | |
| && echo $file \ | |
| && perl -0777 -i -pe 's/\/\*{1,2}[\s]+\* \@see (([A-Z]+\-[0-9]+(, )?)+)([\s]+\*){1,2}\/[\s]+((\@[^T][\w]+.*[\s]+)?\@Test(\([^\)]+\))?)/$5 \/\/ $1/gm' $file | |
| grep -E "@see [A-Z]+\-[0-9]+" $file \ | |
| && perl -0777 -i -pe 's/\/\*{1,2}[\s]+\* \@see ([A-Z]+\-[0-9]+)([\s]+\*){1,2}\//\/\/ $1/gm' $file | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment