l2tscaffolder.helpers package¶
Submodules¶
l2tscaffolder.helpers.cli module¶
Helper for command line functions.
l2tscaffolder.helpers.git module¶
Git helper for the scaffolder project.
This file provides a class to assist with git operations.
-
class
l2tscaffolder.helpers.git.
GitHelper
(project_path: str)[source]¶ Bases:
l2tscaffolder.helpers.cli.CLIHelper
Helper class for git operations.
-
project_path
¶ path to the git project folder.
-
AddFileToTrack
(file_path: str)[source]¶ Add a file to those that are tracked by the git repo.
Parameters: file_path (str) – path to the file to be added to tracked files by this git repo. Raises: errors.UnableToConfigure
– when the tool is not able to add newly added files to the git repo.
-
CreateBranch
(branch: str) → int[source]¶ Creates a git branch and returns the exit code of the command.
Parameters: branch (str) – the name of the git branch. Returns: the exit code from the git command. Return type: int
-
GenerateBranchName
(module_name: str) → str[source]¶ Generates a git branch name.
Parameters: module_name (str) – module name to generate a git branch name from. Returns: git branch name. Return type: str
-
GetActiveBranch
() → str[source]¶ Determines the active branch of the git project.
Returns: the active branch of the git project. Return type: str Raises: errors.UnableToConfigure
– when the tool is not able to get the active branch of the git project.
-
HasBranch
(branch_name: str) → bool[source]¶ Tests for the existence of a specific branch.
Parameters: branch_name (str) – the name of the branch to test for. Returns: True if the branch exists. Return type: bool
-