stubber.codemod.enrich

Module Contents

Functions

enrich_file(→ Optional[str])

Enrich a firmware stubs using the doc-stubs in another folder.

enrich_folder(→ int)

Enrich a folder with containing firmware stubs using the doc-stubs in another folder.

stubber.codemod.enrich.enrich_file(target_path: pathlib.Path, docstub_path: pathlib.Path, diff=False, write_back=False) Optional[str]

Enrich a firmware stubs using the doc-stubs in another folder. Both (.py or .pyi) files are supported.

Parameters
  • source_path – the path to the firmware stub to enrich

  • docstub_path (pathlib.Path) – the path to the folder containg the doc-stubs

  • diff – if True, return the diff between the original and the enriched source file

  • write_back – if True, write the enriched source file back to the source_path

  • target_path (pathlib.Path) –

Return type

Optional[str]

Returns: - None or a string containing the diff between the original and the enriched source file

stubber.codemod.enrich.enrich_folder(source_folder: pathlib.Path, docstub_path: pathlib.Path, show_diff=False, write_back=False, require_docstub=False) int

Enrich a folder with containing firmware stubs using the doc-stubs in another folder.

Returns the number of files enriched.

Parameters
Return type

int