Guest User

Untitled

a guest
Sep 25th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. j=$1
  2.  
  3. echo "Marking $j"
  4.  
  5. # add line numbers and line-length header, outputs
  6. # to the new '$j.annotated.txt' file
  7. _lines $j
  8.  
  9. # add tab count footer
  10. 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
  11.  
  12. # remove spaces from annotated source file
  13. cat $j.annotated.txt | sed 's/\t/ /g' > temp
  14. mv temp $j.annotated.txt
  15.  
  16. # remove spaces from source to be marked
  17. cat $j | sed 's/\t/ /g' > $j.spaces.c
  18.  
  19. # run actual style marking
  20. vera++ -rule csse2310 $j.spaces.c 2> $j.veraout.txt
  21.  
  22. # merge the errors listed back into a new file $j.errors.c
  23. _merge $j.annotated.txt $j.veraout.txt > $j.errors.c
  24.  
  25. # clean up temp files
  26. rm $j.annotated.txt $j.spaces.c $j.veraout.txt
Add Comment
Please, Sign In to add comment