rosdistro_reviewer.element_analyzer package

Submodules

rosdistro_reviewer.element_analyzer.rosdep module

class rosdistro_reviewer.element_analyzer.rosdep.RosdepAnalyzer

Bases: ElementAnalyzerExtensionPoint

Element analyzer for changes to the rosdep database.

analyze(path: Path, target_ref: str | None = None, head_ref: str | None = None) Tuple[List[Criterion] | None, List[Annotation] | None]

Perform analysis to collect criteria and annotations.

The method is intended to be overridden in a subclass.

Parameters:
  • path – Path on disk to the git repository

  • target_ref – The git ref to base the diff from

  • head_ref – The git ref where the changes have been made

Returns:

A tuple with a list of criteria and a list of annotations

rosdistro_reviewer.element_analyzer.yamllint module

class rosdistro_reviewer.element_analyzer.yamllint.YamllintAnalyzer

Bases: ElementAnalyzerExtensionPoint

Element analyzer for linting changes to YAML files.

analyze(path: Path, target_ref: str | None = None, head_ref: str | None = None) Tuple[List[Criterion] | None, List[Annotation] | None]

Perform analysis to collect criteria and annotations.

The method is intended to be overridden in a subclass.

Parameters:
  • path – Path on disk to the git repository

  • target_ref – The git ref to base the diff from

  • head_ref – The git ref where the changes have been made

Returns:

A tuple with a list of criteria and a list of annotations

Module contents

class rosdistro_reviewer.element_analyzer.ElementAnalyzerExtensionPoint

Bases: object

The interface for element analyzers.

An element analyzer extension provides criteria and annotations for composing a rosdistro review.

EXTENSION_POINT_VERSION = '1.0'
analyze(path: Path, target_ref: str | None = None, head_ref: str | None = None) Tuple[List[Criterion] | None, List[Annotation] | None]

Perform analysis to collect criteria and annotations.

The method is intended to be overridden in a subclass.

Parameters:
  • path – Path on disk to the git repository

  • target_ref – The git ref to base the diff from

  • head_ref – The git ref where the changes have been made

Returns:

A tuple with a list of criteria and a list of annotations

rosdistro_reviewer.element_analyzer.analyze(path: Path, *, extensions: Dict[str, ElementAnalyzerExtensionPoint] | None = None, target_ref: str | None = None, head_ref: str | None = None) Review | None

Invoke each analyzer and construct a rosdistro review.

Parameters:
  • path – Path on disk to the git repository

  • extensions – The element analyzer extensions to use, if None is passed use the extensions provided by get_element_analyzer_extensions()

  • target_ref – The git ref to base the diff from

  • head_ref – The git ref where the changes have been made

Returns:

A new review instance, or None if no analyzer extensions performed any analysis

rosdistro_reviewer.element_analyzer.get_element_analyzer_extensions(*, group_name: str | None = None) Dict[str, ElementAnalyzerExtensionPoint]

Get the available element analyzers extensions.

Parameters:

group_name – Optional extension point group name override

Return type:

Dict