-
+
diff --git a/bigtop-manager-ui/tests/__utils__/array.test.ts b/bigtop-manager-ui/tests/__utils__/array.test.ts
index 0eaf3d00f..5bcb737d7 100644
--- a/bigtop-manager-ui/tests/__utils__/array.test.ts
+++ b/bigtop-manager-ui/tests/__utils__/array.test.ts
@@ -17,7 +17,7 @@
* under the License.
*/
-import { arrayEquals } from '../../src/utils/array.ts' // 替换成实际的文件路径
+import { arrayEquals } from '../../src/utils/array.ts' // Replace with the actual file path
import { describe, expect, test } from 'vitest'
describe('arrayEquals', () => {
From a7da63aac4af73ea41b7e9bcebb8c9db19cd667d Mon Sep 17 00:00:00 2001
From: wuchunfu <319355703@qq.com>
Date: Sat, 15 Feb 2025 20:17:00 +0800
Subject: [PATCH 15/17] BIGTOP-4361: Add Chinese check
---
.github/check_chinese_character.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/check_chinese_character.py b/.github/check_chinese_character.py
index 90f735109..85f6a55aa 100644
--- a/.github/check_chinese_character.py
+++ b/.github/check_chinese_character.py
@@ -32,7 +32,7 @@ class ChineseCharacterCheckTest:
"dist",
}
# Supported file extensions
- SUPPORTED_EXTENSIONS = {".java", ".kt", ".scala", ".js", ".ts", ".vue"}
+ SUPPORTED_EXTENSIONS = {".java", ".kt", ".scala", ".js", ".jsx", ".ts", ".tsx", ".vue"}
def should_not_contain_chinese_in_comments(self):
violations = self.scan_for_chinese_characters(ScanTarget.COMMENTS)
From 9052425a1df6f6bb0741de42008bb41262c52d3a Mon Sep 17 00:00:00 2001
From: wuchunfu <319355703@qq.com>
Date: Sat, 15 Feb 2025 20:18:12 +0800
Subject: [PATCH 16/17] BIGTOP-4361: Add Chinese check
---
.github/check_chinese_character.py | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/.github/check_chinese_character.py b/.github/check_chinese_character.py
index 85f6a55aa..273a2f7ce 100644
--- a/.github/check_chinese_character.py
+++ b/.github/check_chinese_character.py
@@ -32,7 +32,16 @@ class ChineseCharacterCheckTest:
"dist",
}
# Supported file extensions
- SUPPORTED_EXTENSIONS = {".java", ".kt", ".scala", ".js", ".jsx", ".ts", ".tsx", ".vue"}
+ SUPPORTED_EXTENSIONS = {
+ ".java",
+ ".kt",
+ ".scala",
+ ".js",
+ ".jsx",
+ ".ts",
+ ".tsx",
+ ".vue"
+ }
def should_not_contain_chinese_in_comments(self):
violations = self.scan_for_chinese_characters(ScanTarget.COMMENTS)
From d12a516d3ea74b801c5481357ff6fe075e582d78 Mon Sep 17 00:00:00 2001
From: wuchunfu <319355703@qq.com>
Date: Sat, 15 Feb 2025 20:22:35 +0800
Subject: [PATCH 17/17] BIGTOP-4361: Add Chinese check
---
.github/check_chinese_character.py | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/.github/check_chinese_character.py b/.github/check_chinese_character.py
index 273a2f7ce..3479066f7 100644
--- a/.github/check_chinese_character.py
+++ b/.github/check_chinese_character.py
@@ -23,7 +23,7 @@
from pathlib import Path
from typing import List, Set
-class ChineseCharacterCheckTest:
+class chinese_character_check_test:
CHINESE_CHAR_PATTERN = re.compile(r'[\u4e00-\u9fa5]')
# Exclude directories or files. If it is a file, just write the file name. The same is true for directories, just write the directory name.
EXCLUDED_DIRS_AND_FILES = {
@@ -44,10 +44,10 @@ class ChineseCharacterCheckTest:
}
def should_not_contain_chinese_in_comments(self):
- violations = self.scan_for_chinese_characters(ScanTarget.COMMENTS)
+ violations = self.scan_for_chinese_characters(scan_target.COMMENTS)
self.assert_no_chinese_characters(violations)
- def scan_for_chinese_characters(self, target: 'ScanTarget') -> List[str]:
+ def scan_for_chinese_characters(self, target: 'scan_target') -> List[str]:
violations = []
for ext in self.SUPPORTED_EXTENSIONS:
for path in Path("..").rglob(f"*{ext}"):
@@ -63,7 +63,7 @@ def is_valid_file(self, path: Path) -> bool:
path_str = str(path)
return any(path_str.endswith(ext) for ext in self.SUPPORTED_EXTENSIONS)
- def process_file(self, path: Path, target: 'ScanTarget', violations: List[str]):
+ def process_file(self, path: Path, target: 'scan_target', violations: List[str]):
try:
with open(path, 'r', encoding='utf-8') as file:
content = file.read()
@@ -104,7 +104,7 @@ def format_violation(self, path: Path, location: str, content: str) -> str:
def assert_no_chinese_characters(self, violations: List[str]):
assert len(violations) == 0, f"Found Chinese characters in files:\n{os.linesep.join(violations)}"
-class ScanTarget:
+class scan_target:
def __init__(self, check_comments: bool, check_code: bool):
self.check_comments = check_comments
self.check_code = check_code
@@ -115,10 +115,10 @@ def include_comments(self) -> bool:
def include_code(self) -> bool:
return self.check_code
-ScanTarget.COMMENTS = ScanTarget(True, False)
-ScanTarget.CODE = ScanTarget(False, True)
-ScanTarget.ALL = ScanTarget(True, True)
+scan_target.COMMENTS = scan_target(True, False)
+scan_target.CODE = scan_target(False, True)
+scan_target.ALL = scan_target(True, True)
if __name__ == "__main__":
- test = ChineseCharacterCheckTest()
+ test = chinese_character_check_test()
test.should_not_contain_chinese_in_comments()