!6646 [MSLITE][Develop] check format support lite
Merge pull request !6646 from sunsuodong/fix_code
This commit is contained in:
commit
edd8214459
|
@ -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__
|
||||
|
|
|
@ -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…
Reference in New Issue