From acfaa8c0017e5e6e99f145c42594629c96916b8a Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Wed, 31 Jul 2024 11:30:11 -0300 Subject: [PATCH] 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. --- scripts/blame.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/blame.py b/scripts/blame.py index 2b94f7f78..6e280be20 100755 --- a/scripts/blame.py +++ b/scripts/blame.py @@ -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: