repo_helper.core

Core functionality of repo_helper.

Classes:

RepoHelper(target_repo[, managed_message])

Repo Helper: Manage configuration files with ease.

Functions:

import_registered_functions()

Returns a list of all registered functions.

class RepoHelper(target_repo, managed_message="This file is managed by 'repo_helper'. Don't edit it directly.")[source]

Repo Helper: Manage configuration files with ease.

Parameters
  • target_repo (Union[str, Path, PathLike]) – The path to the root of the repository to manage files for.

  • managed_message (str) – Message placed at the top of files to indicate that they are managed by repo_helper. Default "This file is managed by 'repo_helper'. Don't edit it directly.".

Attributes:

exclude_files

A tuple of excluded files that should NOT be managed by Git Helper.

files

List of functions to manage files.

managed_message

Message placed at the top of files to indicate that they are managed by repo_helper.

repo_name

The name of the repository being managed.

target_repo

The target repository

templates

Provides the templates and stores the configuration.

Methods:

load_settings([allow_unknown_keys])

Load settings from the repo_helper.yml file in the repository.

run()

Run Git Helper for the repository and update all managed files.

property exclude_files

A tuple of excluded files that should NOT be managed by Git Helper.

Return type

Tuple[str, …]

files

Type:    Management

List of functions to manage files.

load_settings(allow_unknown_keys=False)[source]

Load settings from the repo_helper.yml file in the repository.

Parameters

allow_unknown_keys (bool) – Whether unknown keys should be allowed in the configuration file. Default False.

Changed in version 2021.2.18:
  • This method is no longer called automatically when instantiating the RepoHelper class.

  • Added the allow_unknown_keys argument.

property managed_message

Message placed at the top of files to indicate that they are managed by repo_helper.

Return type

str

property repo_name

The name of the repository being managed.

Return type

str

run()[source]

Run Git Helper for the repository and update all managed files.

Return type

List[str]

Returns

A list of files managed by Git Helper, regardless of whether they were added, removed or modified.

target_repo

Type:    PathPlus

The target repository

templates

Type:    Environment

Provides the templates and stores the configuration.

import_registered_functions()[source]

Returns a list of all registered functions.

Return type

List[Type]