MCPcopy Create free account
hub / github.com/doldecomp/mkdd / main

Function main

tools/changes_fmt.py:124–158  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

122
123
124def main():
125 parser = ArgumentParser(description="Format objdiff-cli report changes.")
126 parser.add_argument(
127 "report_changes_file",
128 type=Path,
129 help="""path to the JSON file containing the changes, generated by objdiff-cli.""",
130 )
131 parser.add_argument(
132 "-o",
133 "--output",
134 type=Path,
135 help="""Output file (prints to console if unspecified)""",
136 )
137 parser.add_argument(
138 "--all",
139 action="store_true",
140 help="""Includes progressions as well.""",
141 )
142 args = parser.parse_args()
143
144 regressions, progressions = get_changes(args.report_changes_file)
145
146 if args.output:
147 markdown_output = generate_changes_markdown(regressions, "regressions")
148 if args.all:
149 markdown_output += generate_changes_markdown(progressions, "progressions")
150 with open(args.output, "w", encoding="utf-8") as f:
151 f.write(markdown_output)
152 else:
153 if args.all:
154 changes = progressions + regressions
155 else:
156 changes = regressions
157 text_output = generate_changes_plaintext(changes)
158 print(text_output)
159
160
161if __name__ == "__main__":

Callers 1

changes_fmt.pyFile · 0.70

Calls 5

get_changesFunction · 0.85
openFunction · 0.85
writeMethod · 0.45

Tested by

no test coverage detected