您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 

40 行
955 B

  1. #!/bin/sh
  2. set -e
  3. # Find out where the top directory is and go there
  4. top_srcdir="$(cd "$(dirname $0)"; cd ..; pwd)"
  5. cd "$top_srcdir"
  6. # Find out what kind of Vcs directory this is
  7. if [ -f "$top_srcdir/.git/index" ]; then
  8. echo "I: detected Git repository"
  9. repo=git
  10. elif [ -f "$top_srcdir/.svn/format" ]; then
  11. echo "I: detected SVN repository"
  12. repo=svn
  13. else
  14. echo "I: not in a Vcs directory, nothing to do"
  15. exit 0
  16. fi
  17. if [ "$repo" = git ]; then
  18. git ls-files
  19. else
  20. :
  21. fi | while read file; do
  22. case "$file" in
  23. src/bullet/*|contrib/*|people/*|*/generated/*)
  24. : # These files aren't ours, don't fix
  25. ;;
  26. *.c|*.cpp|*.h)
  27. ntabs="$(grep -c -P '\t' "$file" || true)"
  28. nspaces="$(grep -c ' $' "$file" || true)"
  29. total="$(($ntabs + $nspaces))"
  30. if [ "$total" != 0 ]; then
  31. echo "E: $total lines with tabs in $file"
  32. fi
  33. ;;
  34. esac
  35. done