Files
Investidor-V2/outputs/investmoz-audit-current-20261012/format-B2-report.py
T
nala 287e991486
tests / ci (push) Waiting to run
oportunidades 7
2026-10-13 11:40:29 +02:00

27 lines
1.5 KiB
Python

from pathlib import Path
import re
OUT=Path(__file__).resolve().parent;DOC=OUT.parents[1]/'docs/investmoz/v2/auditoria-portal'
def readable(text):
pieces=re.split(r'(`[^`]*`)',text)
for i,p in enumerate(pieces):
if p.startswith('`'):continue
p=re.sub(r'(\d)(?=[A-Za-zÀ-ÿ])',r'\1 ',p)
p=re.sub(r'(?<=[a-zà-ÿ])(?=\d)',' ',p)
p=re.sub(r'(?<=[,;])(?=[\wÀ-ÿ])',' ',p)
p=re.sub(r'([a-zà-ÿ])(?=(?:C\d+|QA\d+|API|MFA|HTTP|SQL|TXT|PDF|UTC))',r'\1 ',p)
p=p.replace('PDFservidor','PDF do servidor').replace('eoslimiteshistóricos','e os limites históricos')
pieces[i]=p
return ''.join(pieces)
names=['saldo-opcao-B.md','relatorio-executivo.md','backlog.md','visao-consolidada-modulos.md',
'consumidores-restantes.md','workflow-criterios-saida-20261011.md','execucao-B-QA.md',
'casos-reproducao.md','C132-incidente-contido.md']
for n in names:
p=DOC/n;t=p.read_text(encoding='utf-8')
if n=='saldo-opcao-B.md':t=readable(t)
elif n=='casos-reproducao.md':at=t.index('\n## C140 ');t=t[:at]+readable(t[at:])
elif n=='C132-incidente-contido.md':at=t.index('\n## Confirmação manual da conta14 ');t=t[:at]+readable(t[at:])
else:
end=t.index('<!-- /option-B2-saldo-20261013 -->')+len('<!-- /option-B2-saldo-20261013 -->');t=readable(t[:end])+t[end:]
p.write_text(t,encoding='utf-8');(OUT/'para-revisao'/n).write_bytes(p.read_bytes())
print('Current B2 prose spaced; historical sections and frozen scope unchanged.')