Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 
 
 
 

39 rindas
810 B

  1. #!/bin/sh
  2. #
  3. # Check that we have no tabs or trailing spaces in the source code
  4. #
  5. nfails=0
  6. nfiles=0
  7. nlines=0
  8. for dir in caca kernel src cxx examples ruby tools; do
  9. pushd ../$dir >/dev/null
  10. for x in $(make -s echo-sources); do
  11. case "$x" in
  12. *.c|*.cpp|*.h|*.m)
  13. nfiles=$(($nfiles + 1));
  14. nlines=$(($nlines + `grep -c . "$x"`)) ;;
  15. *)
  16. continue ;;
  17. esac
  18. if grep '[[:space:]]$' "$x" >/dev/null 2>&1; then
  19. echo "error: $dir/$x contains trailing spaces"
  20. nfails=$(($nfails + 1))
  21. fi
  22. if grep ' ' "$x" >/dev/null 2>&1; then
  23. echo "error: $dir/$x contains tabs"
  24. nfails=$(($nfails + 1))
  25. fi
  26. done
  27. popd >/dev/null
  28. done
  29. echo "$nfiles files, $nlines lines, $nfails errors in source code"
  30. if test "$nfails" != "0"; then
  31. exit 1
  32. fi
  33. exit 0