renderdiff: separate comparison from rendering (#8733)

- Move the comparison logic into its own script
- Add entry point bash script to generate the renderings
- Separate the preamble bash logic into its own file
This commit is contained in:
Powei Feng
2025-05-14 09:48:16 -07:00
committed by GitHub
parent 78419cd992
commit 361ba2afea
10 changed files with 218 additions and 142 deletions

View File

@@ -106,3 +106,13 @@ def mkdir_p(path_str):
def mv_f(src_str, dst_str):
src = pathlib.Path(src_str)
src.replace(dst_str)
def important_print(msg):
lines = msg.split('\n')
max_len = max([len(l) for l in lines])
print('-' * (max_len + 8))
for line in lines:
diff = max_len - len(line)
information = f'--- {line} ' + (' ' * diff) + '---'
print(information)
print('-' * (max_len + 8))