From 28b1e1c820629c73650387d12f9c1635fb927447 Mon Sep 17 00:00:00 2001 From: ooooo <3164076421@qq.com> Date: Sun, 29 Oct 2023 17:41:05 +0800 Subject: [PATCH 1/2] enable F821 --- ci_scripts/check_copy_from_parsed_into_sample_code.py | 1 + pyproject.toml | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ci_scripts/check_copy_from_parsed_into_sample_code.py b/ci_scripts/check_copy_from_parsed_into_sample_code.py index 838b34f216f..d46cb43a9a8 100644 --- a/ci_scripts/check_copy_from_parsed_into_sample_code.py +++ b/ci_scripts/check_copy_from_parsed_into_sample_code.py @@ -24,6 +24,7 @@ def check_copy_from_not_parsed(file): def run_copy_from_check(output_path, pr_files): print('COPY-FROM check files: ', pr_files, ' in ', output_path) all_error_parsed = [] + error_parsed = [] if not pr_files: print("pr file list is empty, skip COPY-FROM check") sys.exit(0) diff --git a/pyproject.toml b/pyproject.toml index ecc17ef1f8d..d6ffe28c35b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -84,6 +84,5 @@ ignore = [ "E401", "E711", "E712", - "F811", - "F821" + "F811" ] From 76ccc3c83f7018ed7245755215964aa41765f067 Mon Sep 17 00:00:00 2001 From: ooooo <3164076421@qq.com> Date: Sun, 29 Oct 2023 17:47:14 +0800 Subject: [PATCH 2/2] fix --- ci_scripts/check_copy_from_parsed_into_sample_code.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ci_scripts/check_copy_from_parsed_into_sample_code.py b/ci_scripts/check_copy_from_parsed_into_sample_code.py index d46cb43a9a8..14424efdf40 100644 --- a/ci_scripts/check_copy_from_parsed_into_sample_code.py +++ b/ci_scripts/check_copy_from_parsed_into_sample_code.py @@ -24,13 +24,12 @@ def check_copy_from_not_parsed(file): def run_copy_from_check(output_path, pr_files): print('COPY-FROM check files: ', pr_files, ' in ', output_path) all_error_parsed = [] - error_parsed = [] if not pr_files: print("pr file list is empty, skip COPY-FROM check") sys.exit(0) for file in pr_files: if '_cn.rst' not in file: - return error_parsed + continue # find the Chinese HTML file for PR File error_parsed = check_copy_from_not_parsed( output_path + file.replace('_cn.rst', '_cn.html')