File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -98,7 +98,17 @@ def relative_filepaths(self)->List[str]:
9898 return [
9999 str (filepath .relative_to (self .rootpath )).replace ("\\ " , "/" ) for filepath in self .files
100100 ]
101-
101+
102+ @property
103+ def relative_directories (self ) -> List [str ]:
104+ dirs = set ()
105+ for filepath in self .files :
106+ p = filepath .resolve ().parent
107+ while p != self .rootpath :
108+ dirs .add (p .relative_to (self .rootpath ).as_posix ())
109+ p = p .parent
110+ return sorted (dirs )
111+
102112 @property
103113 def filenames_mapped (self )-> Dict [str , str ]:
104114 return {
@@ -108,7 +118,7 @@ def filenames_mapped(self)->Dict[str, str]:
108118
109119 @property
110120 def cached_ids (self )-> List [str ]:
111- return self .codebase .non_import_unique_ids + self .relative_filepaths
121+ return self .codebase .non_import_unique_ids + self .relative_filepaths + self . relative_directories
112122
113123 @property
114124 def repo (self )-> Optional [pygit2 .Repository ]:
You can’t perform that action at this time.
0 commit comments