浏览代码

test: put back commit feature in check-source.sh.

legacy
Sam Hocevar 9 年前
父节点
当前提交
168dbb0e00
共有 1 个文件被更改,包括 10 次插入1 次删除
  1. +10
    -1
      build/check-source.sh

+ 10
- 1
build/check-source.sh 查看文件

@@ -176,7 +176,15 @@ done
IFS="$OIFS" IFS="$OIFS"


if [ "$total_errors" -gt 0 ]; then if [ "$total_errors" -gt 0 ]; then
if [ "$fix" = "true" ]; then
if [ "$commit" = "true" ]; then
# EITHER: commit all modified files
git commit --author 'Lolbot <lolbot@zoy.org>' -a -F - << EOF
fixed $total_errors files out of $total_files:
- removed $total_crlfs CR characters
- removed $total_spaces trailing whitespaces
- replaced $total_tabs tabs with spaces
EOF
elif [ "$fix" = "true" ]; then
# OR: report in stdout # OR: report in stdout
info "fixed $total_errors files out of $total_files:" info "fixed $total_errors files out of $total_files:"
if [ "$total_crlfs" -gt 0 ]; then if [ "$total_crlfs" -gt 0 ]; then
@@ -188,6 +196,7 @@ if [ "$total_errors" -gt 0 ]; then
if [ "$total_tabs" -gt 0 ]; then if [ "$total_tabs" -gt 0 ]; then
info " - fixed $total_tabs tabs" info " - fixed $total_tabs tabs"
fi fi
info "re-run with -c to commit fixes"
else else
# OR: warn about how to fix errors # OR: warn about how to fix errors
info "re-run with -w to fix errors" info "re-run with -w to fix errors"


正在加载...
取消
保存