mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-31 01:35:00 +00:00
style: fix string quote consistency in blame.py
This commit is contained in:
parent
13318219db
commit
554d274fff
1 changed files with 6 additions and 6 deletions
|
@ -149,15 +149,15 @@ def main():
|
||||||
# If output file exists, read and update it
|
# If output file exists, read and update it
|
||||||
existing_results = []
|
existing_results = []
|
||||||
if args.output and os.path.exists(args.output):
|
if args.output and os.path.exists(args.output):
|
||||||
with open(args.output, 'r') as f:
|
with open(args.output, "r") as f:
|
||||||
existing_results = yaml.safe_load(f) or []
|
existing_results = yaml.safe_load(f) or []
|
||||||
|
|
||||||
# Create a map of start_tag->end_tag to result for existing entries
|
# Create a map of start_tag->end_tag to result for existing entries
|
||||||
existing_map = {(r['start_tag'], r['end_tag']): i for i, r in enumerate(existing_results)}
|
existing_map = {(r["start_tag"], r["end_tag"]): i for i, r in enumerate(existing_results)}
|
||||||
|
|
||||||
# Update or append new results
|
# Update or append new results
|
||||||
for new_result in new_results:
|
for new_result in new_results:
|
||||||
key = (new_result['start_tag'], new_result['end_tag'])
|
key = (new_result["start_tag"], new_result["end_tag"])
|
||||||
if key in existing_map:
|
if key in existing_map:
|
||||||
# Replace existing entry
|
# Replace existing entry
|
||||||
existing_results[existing_map[key]] = new_result
|
existing_results[existing_map[key]] = new_result
|
||||||
|
@ -166,7 +166,7 @@ def main():
|
||||||
existing_results.append(new_result)
|
existing_results.append(new_result)
|
||||||
|
|
||||||
# Sort results by start_tag
|
# Sort results by start_tag
|
||||||
existing_results.sort(key=lambda x: semver.Version.parse(x['start_tag'][1:]))
|
existing_results.sort(key=lambda x: semver.Version.parse(x["start_tag"][1:]))
|
||||||
|
|
||||||
yaml_output = yaml.dump(existing_results, sort_keys=True)
|
yaml_output = yaml.dump(existing_results, sort_keys=True)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue