Factory

class neophile.factory.Factory(config: Configuration, session: ClientSession)

Bases: object

Factory to create neophile components.

Parameters

Methods Summary

create_all_analyzers(path, *[, use_venv])

Create all analyzers.

create_all_scanners(path)

Create all scanners.

create_helm_analyzer(path)

Create a new Helm analyzer.

create_helm_inventory()

Create a new Helm inventory.

create_kustomize_analyzer(path)

Create a new Helm analyzer.

create_pre_commit_analyzer(path)

Create a new pre-commit hook analyzer.

create_processor()

Create a new repository processor.

create_pull_requester(path)

Create a new pull requester.

create_python_analyzer(path, *[, use_venv])

Create a new Python frozen dependency analyzer.

Methods Documentation

create_all_analyzers(path: Path, *, use_venv: bool = False) List[BaseAnalyzer]

Create all analyzers.

Parameters
  • path (pathlib.Path) – Path to the Git repository.

  • use_venv (bool, optional) – Whether to use a virtualenv to isolate analysis. Default is false.

Returns

analyzers – List of all available analyzers.

Return type

List[neophile.analysis.base.BaseAnalyzer]

Notes

The Python analyzer requires a clean Git tree in order to determine if any changes were necessary, and therefore must run first if the analyzers are run in update mode (which means they will make changes to the working tree).

create_all_scanners(path: Path) List[BaseScanner]

Create all scanners.

Parameters

path (pathlib.Path) – Path to the Git repository to scan.

Returns

scanners – List of all available scanners.

Return type

List[neophile.scanner.base.BaseScanner]

create_helm_analyzer(path: Path) HelmAnalyzer

Create a new Helm analyzer.

Parameters

path (pathlib.Path) – Path to the Git repository.

Returns

analyzer – New analyzer.

Return type

neophile.analysis.helm.HelmAnalyzer

create_helm_inventory() neophile.inventory.helm.HelmInventory

Create a new Helm inventory.

Uses the configuration to determine whether this should be a cached inventory and, if so, where to put the cache.

Returns

inventory – New inventory.

Return type

neophile.inventory.helm.HelmInventory

create_kustomize_analyzer(path: Path) KustomizeAnalyzer

Create a new Helm analyzer.

Parameters

path (pathlib.Path) – Path to the Git repository.

Returns

analyzer – New analyzer.

Return type

neophile.analysis.kustomize.KustomizeAnalyzer

create_pre_commit_analyzer(path: Path) PreCommitAnalyzer

Create a new pre-commit hook analyzer.

Parameters

path (pathlib.Path) – Path to the Git repository.

Returns

analyzer – New analyzer.

Return type

neophile.analysis.pre_commit.PreCommitAnalyzer

create_processor() neophile.processor.Processor

Create a new repository processor.

create_pull_requester(path: Path) PullRequester

Create a new pull requester.

Parameters

path (pathlib.Path) – Path to the Git repository.

Returns

pull_requester – New pull requester.

Return type

neophile.pr.PullRequester

create_python_analyzer(path: Path, *, use_venv: bool = False) PythonAnalyzer

Create a new Python frozen dependency analyzer.

Parameters
  • path (pathlib.Path) – Path to the Git repository.

  • use_venv (bool, optional) – Whether to use a virtualenv to isolate analysis. Default is false.

Returns

analyzer – New analyzer.

Return type

neophile.analysis.python.PythonAnalyzer