Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
Add Comment
Please, Sign In to add comment