test(dacli): final dogfood regression test — all 9 success criteria PASS
This commit is contained in:
1 parent
761405a8b7
commit
a650cf6b04
2 files changed
+23
-9
No files matched your search
Binary file not shown.
@@ -24,12 +24,15 @@ def clean_line(line: str) -> str:
|
||||
line = re.sub(r'BS-\S+\s*(?:fix|修复|修正|强化|兜底)?\s*:\s*', '', line)
|
||||
line = re.sub(r'BS-\S+\s+', '', line) # "// BS-XX explanation" -> "// explanation"
|
||||
|
||||
# --- Pattern 2: R tags ---
|
||||
if re.match(r'^\s*//\s*R\d+[a-z]*\s*$', line): return ''
|
||||
if re.match(r'^\s*\*\s*R\d+[a-z]*\s*$', line): return ''
|
||||
line = re.sub(r'R\d+[a-z]*\s+P\d+-\d+\s*:\s*', '', line)
|
||||
line = re.sub(r'R\d+[a-z]*\s*(?:fix|修复|修正)?\s*:\s*', '', line)
|
||||
line = re.sub(r'R\d+[a-z]*\s+', '', line)
|
||||
# --- Pattern 2: R tags (R17, R3.3, R13a, etc.) ---
|
||||
if re.match(r'^\s*//\s*\(?R\d+(?:\.\d+)?[a-z]*\)?\s*$', line): return ''
|
||||
if re.match(r'^\s*\*\s*\(?R\d+(?:\.\d+)?[a-z]*\)?\s*$', line): return ''
|
||||
# R17 P1-3: text
|
||||
line = re.sub(r'R\d+(?:\.\d+)?[a-z]*\s+P\d+-\d+\s*:\s*', '', line)
|
||||
# (R3.3): text or R3.3: text or R3.3 fix: text
|
||||
line = re.sub(r'\(?R\d+(?:\.\d+)?[a-z]*\)?\s*(?:fix|修复|修正)?\s*:\s*', '', line)
|
||||
# (R3.3) text or R3.3 text
|
||||
line = re.sub(r'\(?R\d+(?:\.\d+)?[a-z]*\)?\s+', '', line)
|
||||
|
||||
# --- Pattern 3: Round tags ---
|
||||
if re.match(r'^\s*//\s*Round\d+\s*$', line): return ''
|
||||
@@ -44,11 +47,15 @@ def clean_line(line: str) -> str:
|
||||
line = re.sub(r'\bdevelopSystem\b', 'reference app', line)
|
||||
line = re.sub(r'\btds\b', 'app', line)
|
||||
|
||||
# --- Pattern 5: v0.x+ version markers (handle v0.10, v0.10.1, v0.11h+, v0.21+) ---
|
||||
# --- Pattern 5: v0.x+ version markers (handle v0.10, v0.10.1, v0.11h+, v0.21+, etc.) ---
|
||||
if re.match(r'^\s*//\s*v0\.\d+(?:\.\d+)?[a-z]*\+?\s*$', line): return ''
|
||||
if re.match(r'^\s*\*\s*v0\.\d+(?:\.\d+)?[a-z]*\+?\s*$', line): return ''
|
||||
line = re.sub(r'v0\.\d+(?:\.\d+)?[a-z]*\+?\s*(?:fix|修复|修正)?\s*:\s*', '', line)
|
||||
line = re.sub(r'v0\.\d+(?:\.\d+)?[a-z]*\+?\s+', '', line)
|
||||
# v0.XX+: text or v0.XX.YY: text or v0.XX fix: text
|
||||
line = re.sub(r'v0\.\d+(?:\.\d+)?[a-z]*\+?\s*(?:fix|修复|修正)?\s*:', '', line)
|
||||
# v0.XX+, text or v0.XX+ text or v0.XX+ — text
|
||||
line = re.sub(r'v0\.\d+(?:\.\d+)?[a-z]*\+?[,]?\s+(?:fix|修复|修正)?\s*', '', line)
|
||||
# v0.XX+ remaining (at end of line, no text after)
|
||||
line = re.sub(r'\(?v0\.\d+(?:\.\d+)?[a-z]*\+?\)?', '', line)
|
||||
|
||||
# --- Pattern 6: ssw-*-biz/ssw-common ---
|
||||
# Only in comments. Remove or simplify.
|
||||
@@ -77,10 +84,17 @@ def clean_line(line: str) -> str:
|
||||
line = re.sub(r'^(\s*//\s*)(?:fix:|修复:|修正:|强化:|兜底:)\s*', r'\1', line)
|
||||
line = re.sub(r'^(\s*\*\s*)(?:fix:|修复:|修正:|强化:|兜底:)\s*', r'\1', line)
|
||||
|
||||
# Remove leading ": " after stripping version/date markers at comment start
|
||||
line = re.sub(r'^(\s*//\s*):\s+', r'\1', line)
|
||||
line = re.sub(r'^(\s*\*\s*):\s+', r'\1', line)
|
||||
|
||||
# After all stripping, if main content is gone, delete
|
||||
if re.match(r'^\s*//\s*$', line): return ''
|
||||
if re.match(r'^\s*\*\s*$', line): return ''
|
||||
|
||||
# Trim trailing whitespace
|
||||
line = line.rstrip() + '\n' if line.endswith('\n') else line.rstrip()
|
||||
|
||||
return line
|
||||
|
||||
def clean_file(filepath: str) -> int:
|
||||
|
||||
Reference in new issue
Block a user