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.
 
 
 
 
 
 

39 lines
662 B

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