From 2f72d7c0e2861975a42078f409d547df51ca05e2 Mon Sep 17 00:00:00 2001 From: SigureMo Date: Sun, 13 Oct 2024 22:11:49 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix:=20strip=20original=20line?= =?UTF-8?q?=20end?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dochooks/insert_whitespace_between_cn_and_en_char/check.py | 2 +- dochooks/insert_whitespace_between_cn_and_en_char/format.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dochooks/insert_whitespace_between_cn_and_en_char/check.py b/dochooks/insert_whitespace_between_cn_and_en_char/check.py index 149bfc7..ccfb72e 100644 --- a/dochooks/insert_whitespace_between_cn_and_en_char/check.py +++ b/dochooks/insert_whitespace_between_cn_and_en_char/check.py @@ -36,7 +36,7 @@ def _check_file(file_path: str) -> ReturnCode: need_format, diagnostics = check_lines(f) if need_format: for lineno, line in diagnostics: - print(f"No spaces between EN and CN chars detected at: {file_path}:{lineno}:\t{line}") + print(f"No spaces between EN and CN chars detected at: {file_path}:{lineno}:\t{line.strip()}") return FAIL if need_format else PASS diff --git a/dochooks/insert_whitespace_between_cn_and_en_char/format.py b/dochooks/insert_whitespace_between_cn_and_en_char/format.py index 12f1c27..67bcf5b 100644 --- a/dochooks/insert_whitespace_between_cn_and_en_char/format.py +++ b/dochooks/insert_whitespace_between_cn_and_en_char/format.py @@ -44,7 +44,7 @@ def _format_file(file_path: str) -> ReturnCode: with open(file_path, "w", encoding="utf8", newline="\n") as f: f.write(formatted_text) for lineno, line in diagnostics: - print(f"Add spaces between EN and CN chars in: {file_path}:{lineno}:\t{line}") + print(f"Add spaces between EN and CN chars in: {file_path}:{lineno}:\t{line.strip()}") return FAIL if need_format else PASS