fixml.modules.code_analyzer.git

Classes

GitContext

Module Contents

class fixml.modules.code_analyzer.git.GitContext(git_dir: str | pathlib.Path)
__get_remote_service_family() str

Determine the remote service family.

This will do a keyword-based matching between the remote URL and the dictionary containing URL rules for different supported git hosting service families. For example, remotes pointing to “github.com”, “github.example.com” will return “github”, while “gitlab.example.com” will produce “gitlab”.

Returns:

The key links to git hosting service family.

Return type:

str

_get_current_head() str

Getting the representation of current HEAD.

This is to obtain branch name/commit hash for later use when constructing a URL to the git hosting service.

Returns:

The representation of current HEAD. This could be either the branch name or the commit hash.

Return type:

str

_get_remote_info() tuple[str | None, str | None, str]