diff options
| author | thread-liu <[email protected]> | 2021-05-07 11:06:15 +0800 |
|---|---|---|
| committer | thread-liu <[email protected]> | 2021-05-07 11:08:33 +0800 |
| commit | 86f9b001c77090e695b8df4d4bd3af9315099a7c (patch) | |
| tree | 56b3f2f1b57949094e932505b79a8947f08b96eb | |
| parent | 186466ecc656885705b09a29f2c9b275b1af2daf (diff) | |
[update] file_check.py
| -rw-r--r-- | tools/file_check.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/file_check.py b/tools/file_check.py index e79332b325..046b2a009f 100644 --- a/tools/file_check.py +++ b/tools/file_check.py @@ -144,7 +144,7 @@ class FormatCheck: logging.warning("There are no files to check format.") return True encoding_check_result = True - format_check_result = True + format_check_fail_files = 0 for file_path in self.file_list: code = '' if file_path.endswith(".c") or file_path.endswith(".h"): @@ -166,9 +166,10 @@ class FormatCheck: with open(file_path, 'r', encoding = "utf-8") as f: file_lines = f.readlines() - format_check_result = self.__check_file(file_lines, file_path) + if not self.__check_file(file_lines, file_path): + format_check_fail_files += 1 - if not encoding_check_result or not format_check_result: + if (not encoding_check_result) or (format_check_fail_files != 0): logging.error("files format check fail.") return False |
