Created
April 11, 2012 06:53
-
-
Save adamvr/2357437 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
| j=$1 | |
| echo "Marking $j" | |
| # add line numbers and line-length header, outputs | |
| # to the new '$j.annotated.txt' file | |
| _lines $j | |
| # add tab count footer | |
| grep -cP '\t' $j | gawk '{ if ($1 > 0) print "[INDENTATION] File contained " $1 " tab characters. Indentation should be four spaces per indentation level.\n Each tab was converted to four spaces for style marking. This counts as one style violation." }' >> $j.annotated.txt | |
| # remove spaces from annotated source file | |
| cat $j.annotated.txt | sed 's/\t/ /g' > temp | |
| mv temp $j.annotated.txt | |
| # remove spaces from source to be marked | |
| cat $j | sed 's/\t/ /g' > $j.spaces.c | |
| # run actual style marking | |
| vera++ -rule csse2310 $j.spaces.c 2> $j.veraout.txt | |
| # merge the errors listed back into a new file $j.errors.c | |
| _merge $j.annotated.txt $j.veraout.txt > $j.errors.c | |
| # clean up temp files | |
| rm $j.annotated.txt $j.spaces.c $j.veraout.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment