feat: sort YAML keys alphabetically

The provided changes ensure that the YAML keys are sorted alphabetically when dumping the results and the individual result in the `scripts/blame.py` file. This will provide a deterministic order for the output, making it more consistent across different runs of the script.
This commit is contained in:
Paul Gauthier (aider) 2024-07-31 11:30:11 -03:00
parent 2cc529192d
commit acfaa8c001

View file

@ -136,7 +136,7 @@ def main():
if args.all_since:
results = process_all_tags_since(args.start_tag)
yaml_output = yaml.dump(results, sort_keys=False)
yaml_output = yaml.dump(results, sort_keys=True)
else:
all_file_counts, grand_total, total_lines, aider_total, aider_percentage, end_date = blame(
args.start_tag, args.end_tag
@ -156,7 +156,7 @@ def main():
"aider_percentage": round(aider_percentage, 2),
}
yaml_output = yaml.dump(result, sort_keys=False)
yaml_output = yaml.dump(result, sort_keys=True)
if args.output:
with open(args.output, "w") as f: