Skip to content

Known Bugs and Fixes in construct_graph.py #18

@moonbytex

Description

@moonbytex
  1. Error when a Python file is located in the project root directory
Traceback (most recent call last):
  File "/root/huangjinpeng/RepoGraph/./repograph/construct_graph.py", line 538, in <module>
    tags, G = code_graph.get_code_graph(chat_fnames_new)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/huangjinpeng/RepoGraph/./repograph/construct_graph.py", line 82, in get_code_graph
    tags = self.get_tag_files(other_files, mentioned_fnames)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/huangjinpeng/RepoGraph/./repograph/construct_graph.py", line 89, in get_tag_files
    tags = self.get_ranked_tags(other_files, mentioned_fnames)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/huangjinpeng/RepoGraph/./repograph/construct_graph.py", line 410, in get_ranked_tags
    tags = list(self.get_tags(fname, rel_fname))
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/huangjinpeng/RepoGraph/./repograph/construct_graph.py", line 197, in get_tags
    data = list(self.get_tags_raw(fname, rel_fname))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/huangjinpeng/RepoGraph/./repograph/construct_graph.py", line 206, in get_tags_raw
    s = s[fname_part]

Fix:Add the following lines after s = deepcopy(self.structure) in the get_tags_raw function:

if len(ref_fname_lst) == 1:
    s = s[self.root.split('/')[-1]]
  1. tag['name'] causes an error in tag_to_graph.py

Fix:Change tag['name'] to tag.name.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions