repomatic.cli.repo moduleΒΆ
Repository commands of the repomatic CLI: setup, metadata and file syncs.
repomatic.cli.main.COMMANDS registers each command here, and files it
under its help section.
- class repomatic.cli.repo.ComponentSelector[source]ΒΆ
Bases:
ParamTypeAccepts bare component names or qualified
component/fileselectors.Bare names (e.g.,
skills) select an entire component. Qualified entries (e.g.,skills/repomatic-topics) select a single file within a component. Validation delegates toparse_component_entries(), the same code path theexcludeandincludeconfig options go through, so the CLI and config agree on syntax and error messages.- get_metavar(param, ctx)[source]ΒΆ
Returns the metavar default for this param if it provides one.
- Return type:
- convert(value, param, ctx)[source]ΒΆ
Check that value names a component, or one file of a component.
- Return type:
- Returns:
The selector, unchanged.
- Raises:
click.BadParameter β The selector names neither.
- shell_complete(ctx, param, incomplete)[source]ΒΆ
Return a list of
CompletionItemobjects for the incomplete value. Most types do not provide completions, but some do, and this allows custom types to provide custom completions as well.- Parameters:
Added in version 8.0.
- Return type:
- repomatic.cli.repo.CONFIG_REFERENCE_HEADER_DEFS: tuple[ColumnSpec, ...] = (ColumnSpec(id='option', label='Option', description='', max_width=None, optional=False, sortable=True), ColumnSpec(id='type', label='Type', description='', max_width=24, optional=False, sortable=True), ColumnSpec(id='default', label='Default', description='', max_width=24, optional=False, sortable=True), ColumnSpec(id='description', label='Description', description='', max_width=60, optional=False, sortable=True))ΒΆ
Column definitions for the
[tool.repomatic]configuration reference table.The three columns whose outliers set the whole tableβs width are capped: a
list[dict[str, str | bool | list[str]]]type, a list default, and a description running past a hundred characters.Optionstays uncapped, because wrapping a dotted key splits an identifier mid-token. A format unable to render a wrapped cell drops the caps on its own.
- repomatic.cli.repo.format_config_default(value)[source]ΒΆ
Format a
Configfield default for the reference table.- Return type:
- repomatic.cli.repo.format_config_type(annotation)[source]ΒΆ
Format a type annotation for a raw GFM cell of the reference table.
Strips
| Nonesuffixes, since the default column already shows whetherNoneis the default.Then escapes the outer brackets of a nested generic: mdformat reads
list[dict[str, str]]as a Markdown link reference, and would escape it again on every run. A simple generic likelist[str]has no nested bracket and stays as is. The cell is never wrapped in backticks, where a backslash would render as itself.- Return type: