Browse Source

!6646 [MSLITE][Develop] check format support lite

Merge pull request !6646 from sunsuodong/fix_code
tags/v1.1.0
mindspore-ci-bot Gitee 5 years ago
parent
commit
edd8214459
2 changed files with 6 additions and 6 deletions
  1. +3
    -3
      scripts/check_clang_format.sh
  2. +3
    -3
      scripts/format_source_code.sh

+ 3
- 3
scripts/check_clang_format.sh View File

@@ -86,12 +86,12 @@ cd "${SCRIPTS_PATH}/.." || exit 1
CHECK_LIST_FILE='__checked_files_list__'

if [ "X${mode}" == "Xall" ]; then
find mindspore/{ccsrc,core} -type f -name "*" | grep "\.h$\|\.cc$" > "${CHECK_LIST_FILE}" || true
find mindspore/{ccsrc,core,lite} -type f -name "*" | grep "\.h$\|\.cc$\|\.c$" > "${CHECK_LIST_FILE}" || true
elif [ "X${mode}" == "Xchanged" ]; then
# --diff-filter=ACMRTUXB will ignore deleted files in commit
git diff --diff-filter=ACMRTUXB --name-only | grep "mindspore/ccsrc\|mindspore/core" | grep "\.h$\|\.cc$" > "${CHECK_LIST_FILE}" || true
git diff --diff-filter=ACMRTUXB --name-only | grep "mindspore/ccsrc\|mindspore/core\|mindspore/lite" | grep "\.h$\|\.cc$\|\.c$" > "${CHECK_LIST_FILE}" || true
else # "X${mode}" == "Xlastcommit"
git diff --diff-filter=ACMRTUXB --name-only HEAD~ HEAD | grep "mindspore/ccsrc\|mindspore/core" | grep "\.h$\|\.cc$" > "${CHECK_LIST_FILE}" || true
git diff --diff-filter=ACMRTUXB --name-only HEAD~ HEAD | grep "mindspore/ccsrc\|mindspore/core\|mindspore/lite" | grep "\.h$\|\.cc$\|\.c$" > "${CHECK_LIST_FILE}" || true
fi

CHECK_RESULT_FILE=__code_format_check_result__


+ 3
- 3
scripts/format_source_code.sh View File

@@ -86,11 +86,11 @@ cd "${SCRIPTS_PATH}/.." || exit 1
FMT_FILE_LIST='__format_files_list__'

if [[ "X${mode}" == "Xall" ]]; then
find mindspore/{ccsrc,core} -type f -name "*" | grep "\.h$\|\.cc$" > "${FMT_FILE_LIST}" || true
find mindspore/{ccsrc,core,lite} -type f -name "*" | grep "\.h$\|\.cc$\|\.c$" > "${FMT_FILE_LIST}" || true
elif [[ "X${mode}" == "Xchanged" ]]; then
git diff --name-only | grep "mindspore/ccsrc\|mindspore/core" | grep "\.h$\|\.cc$" > "${FMT_FILE_LIST}" || true
git diff --name-only | grep "mindspore/ccsrc\|mindspore/core\|mindspore/lite" | grep "\.h$\|\.cc$\|\.c$" > "${FMT_FILE_LIST}" || true
else # "X${mode}" == "Xlastcommit"
git diff --name-only HEAD~ HEAD | grep "mindspore/ccsrc\|mindspore/core" | grep "\.h$\|\.cc$" > "${FMT_FILE_LIST}" || true
git diff --name-only HEAD~ HEAD | grep "mindspore/ccsrc\|mindspore/core\|mindspore/lite" | grep "\.h$\|\.cc$\|\.c$" > "${FMT_FILE_LIST}" || true
fi

while read line; do


Loading…
Cancel
Save