You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
818 B

7 days ago
# -*- coding: utf-8 -*-
"""票 09:改动文件 BOM 扫描(AGENTS.md:UTF-8 无 BOM)。"""
import io, sys
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
FILES = [
r'e:\code\crm-backend-matt\crm-opportunity\src\main\java\com\crm\opportunity\service\impl\OpportunityDetailServiceImpl.java',
r'e:\code\crm-backend-matt\crm-opportunity\src\test\java\com\crm\opportunity\service\impl\OpportunityDetailServiceImplTest.java',
r'e:\code\crm-backend-matt\.scratch\opportunity-e2e\seed-opportunity.py',
r'e:\code\crm-backend-matt\.scratch\opportunity-e2e\e2e-core.py',
]
bad = 0
for f in FILES:
with open(f, 'rb') as fh:
head = fh.read(3)
ok = not (head == b'\xef\xbb\xbf')
print(('OK ' if ok else 'BOM ') + f)
bad += 0 if ok else 1
sys.exit(1 if bad else 0)