You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

33 lines
639 B

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