mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-30 01:04:59 +00:00
return string
This commit is contained in:
parent
f8d8a3528b
commit
e4d38f89bb
1 changed files with 13 additions and 6 deletions
|
@ -3,14 +3,19 @@ import json
|
||||||
import sys
|
import sys
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
from aider.dump import dump
|
# from aider.dump import dump
|
||||||
|
|
||||||
|
|
||||||
def print_tags_info(filename):
|
def get_tags_map(filenames):
|
||||||
tags = sorted(get_tags(filename))
|
tags = []
|
||||||
|
for filename in filenames:
|
||||||
|
tags += get_tags(filename)
|
||||||
if not tags:
|
if not tags:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
tags = sorted(tags)
|
||||||
|
|
||||||
|
output = ""
|
||||||
last = [None] * len(tags[0])
|
last = [None] * len(tags[0])
|
||||||
tab = " "
|
tab = " "
|
||||||
for tag in tags:
|
for tag in tags:
|
||||||
|
@ -20,10 +25,12 @@ def print_tags_info(filename):
|
||||||
indent = tab * num_common
|
indent = tab * num_common
|
||||||
rest = tag[num_common:]
|
rest = tag[num_common:]
|
||||||
for item in rest:
|
for item in rest:
|
||||||
print(indent + item)
|
output += indent + item + "\n"
|
||||||
indent += tab
|
indent += tab
|
||||||
last = tag
|
last = tag
|
||||||
|
|
||||||
|
return output
|
||||||
|
|
||||||
|
|
||||||
def split_path(path):
|
def split_path(path):
|
||||||
path = os.path.relpath(path, os.getcwd())
|
path = os.path.relpath(path, os.getcwd())
|
||||||
|
@ -61,5 +68,5 @@ def get_tags(filename):
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
for filename in sys.argv[1:]:
|
res = get_tags_map(sys.argv[1:])
|
||||||
print_tags_info(filename)
|
print(res)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue