清理全库行尾空格与文件尾换行(pre-commit 自动修复基线)

This commit is contained in:
2026-09-01 10:24:50 +08:00
parent 2769bf33a0
commit ae8b1aead5
129 changed files with 2507 additions and 2625 deletions
+3 -3
View File
@@ -122,16 +122,16 @@ for fname, file_fixes in fixes.items():
raw = f.read()
text = raw.decode('utf-8', errors='replace')
before = text.count(rep)
for needle, replacement in file_fixes:
while needle in text:
text = text.replace(needle, replacement)
after = text.count(rep)
fixed = before - after
total_fixed += fixed
print('{}: fixed {} ({} -> {})'.format(fname, fixed, before, after))
with open(path, 'wb') as f:
f.write(text.encode('utf-8'))