25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

35 lines
586 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 echo-sources); do
  10. if grep '[[:space:]]$' "$x" >/dev/null 2>&1; then
  11. echo "error: $dir/$x contains trailing spaces"
  12. failure=1
  13. fi
  14. if grep ' ' "$x" >/dev/null 2>&1; then
  15. echo "error: $dir/$x contains tabs"
  16. failure=1
  17. fi
  18. done
  19. popd >/dev/null
  20. done
  21. if test "$failure" != "0"; then
  22. ret=1
  23. else
  24. echo "0 errors in source code"
  25. fi
  26. if test "$ret" != "0"; then
  27. exit 1
  28. fi
  29. exit 0