Checkers package

class rebasehelper.plugins.checkers.BaseChecker[source]

Base class of package checkers.

DEFAULT

If True, the checker is run by default.

Type:

bool

CATEGORY

Category which determines when the checker is run.

Type:

CheckerCategory

results_dir

Path where the results are stored.

Type:

str

CATEGORY: CheckerCategory | None = None
DEFAULT: bool = False
classmethod format(data)[source]

Formats checker output to a readable text form.

classmethod get_category()[source]
classmethod get_checker_output_dir_short()[source]

Return short version of checker output directory

classmethod get_important_changes(checker_output)[source]

Each checker has an opportunity to highlight some of its output. This function is optional, as not all checkers provide output with critical information.

Parameters:

checker_output (dict) – Dictionary with output from the given checker.

Returns:

List of strings to be output to CLI as warning messages.

Return type:

list

classmethod get_underlined_title(text, separator='=')[source]
classmethod is_available()[source]
classmethod prepare_results_dir()[source]

Creates checker’s results dir.

Removes the existing results dir if it exists to avoid collisions.

results_dir: str | None = None
classmethod run_check(results_dir, **kwargs)[source]

Perform the check itself and return results.

class rebasehelper.plugins.checkers.CheckerCategory(value)[source]

An enumeration.

RPM: int = 3
SOURCE: int = 1
SRPM: int = 2
class rebasehelper.plugins.checkers.CheckerCollection(entrypoint: str, manager: PluginManager)[source]

Class representing the process of running various checkers on final packages.

get_default_plugins(return_one: bool = False) str | List[str] | None[source]
get_supported_plugins() List[str][source]
run(results_dir: str, checker_name: str, **kwargs: Any) Dict[str, Any] | None[source]

Runs a particular checker and returns the results.

Parameters:
  • results_dir – Path to a directory in which the checker should store the results.

  • checker_name – Name of the checker to be run.

Raises:

NotImplementedError – If a checker with the given name doesn’t exist.

Returns:

Results of the checker.