fixml.modules.code_analyzer.repo
Attributes
Classes
Functions
|
Module Contents
- fixml.modules.code_analyzer.repo.logger
- fixml.modules.code_analyzer.repo.requires_git_context(func)
- class fixml.modules.code_analyzer.repo.Repository(path: str)
- normalize_dirs(dirs: Iterable[str | pathlib.Path]) list[pathlib.Path]
Validate and normalize directories in relation to repo’s root path.
This would first convert all relative paths in relation to the repo’s root path, then to validate if the provided list contains valid subdirectories of this repository, meaning that every item: 1. is a directory. 2. does exist. 3. is a subdirectory of the repo’s root (relative transversal beyond
root is not allowed)
Items with overlapping paths e.g. ./src and /src/modules would be reduced to the largest path i.e. ./src which can encompass all overlaps.
- Parameters:
dirs (list[Union[str, Path]]) – A list of directories to normalize. Must be inside the repo’s root directory. An error would be raised if any directory provided does not exist, or if it is not a directory, or if it is not under the root directory.
- Returns:
A list of normalized paths in relation to the root directory.
- Return type:
list[Path]
- get_git_direct_link(file: str, lineno: int | None = None) str
- _get_all_files(include_git_dir: bool = False)
- _get_language_file_map() dict[str, list[str]]
- _get_file_function_lineno_map() dict[str, dict[str, dict[str, int]]]
- list_languages()
- list_packages()
- list_test_files(test_dirs: Iterable[str | pathlib.Path] | None = None) dict[str, list[str]]
List files containing tests in the repository.
- Parameters:
test_dirs (Optional[list[Union[str, Path]]]) – Optional argument to limit the directories to be searched. If not provided, all directories under this repository will be searched.