review.bot.git_interface#

Interface module for local GIT files.

Module Contents#

Classes#

LocalGit

Class to extract information from a diff in a local repository.

Attributes#

LOG

review.bot.git_interface.LOG#
class review.bot.git_interface.LocalGit(repo_path: str)#

Class to extract information from a diff in a local repository.

Parameters:
repo_pathstr

Path to the local repository.

get_filenames()#

Get the filenames of the diff files.

Returns:
list

List with the filenames.

get_local_patch()#

Process the raw diff to extract the filename and useful info.

Returns:
Dict

Dict with the file name as key and the diff as content.

change_branch(branch_name: str)#

Switch the branch of the repo to the required one.

Parameters:
branch_namestr

Branch to switch to.

get_file_sources()#

Get the text from the code files of the diff.

Returns:
Dict

Dict with the file name as key and the source file as content.