diff --git a/tools/netlist_semantics/netlist_sem.py b/tools/netlist_semantics/netlist_sem.py index c05e0d2f..6fed0f42 100644 --- a/tools/netlist_semantics/netlist_sem.py +++ b/tools/netlist_semantics/netlist_sem.py @@ -354,7 +354,10 @@ def render_semantic(packages, nets, pin_index, instances, nets_kb): ap(f'| {ref} | {what} | {desc} |') ap('') - return '\n'.join(L) + '\n' + # 文件结尾必须恰好一个换行:pre-commit end-of-file-fixer 同时禁止 + # “无结尾换行”和“结尾空行”(双换行)。rstrip 归一化末尾多余换行 + # (含上方收尾的 ap('')),今后增删末尾行也不会破坏提交门禁。 + return '\n'.join(L).rstrip('\n') + '\n' def dump_pins(packages, nets):