repomatic.cli package¶
The repomatic command-line interface.
main holds the group, its help sections and the shared plumbing;
each sibling module carries one help section’s commands and
registers them onto the group at import time.
Submodules¶
repomatic.cli.github module¶
GitHub issue and pull request commands of the repomatic CLI.
One module per help section: every command here registers onto the
repomatic group through the section object both import from
repomatic.cli.main, which pulls this module in at startup.
repomatic.cli.lint module¶
Linting and verification commands of the repomatic CLI.
One module per help section: every command here registers onto the
repomatic group through the section object both import from
repomatic.cli.main, which pulls this module in at startup.
repomatic.cli.main module¶
The repomatic command-line group and its shared plumbing.
Commands live in the per-section cli_* sibling modules and register onto
the group defined here; the bottom of this module imports them for that side
effect. What stays here is everything they share: the group, its help
sections, the reusable option declarations, the parameter types, and the
small helpers command bodies lean on.
- repomatic.cli.main.exit_if_disabled(ctx, enabled, key)[source]¶
Exit successfully when a
[tool.repomatic]feature flag is off.The shared guard of every sync command: a disabled feature is a normal, configured state, so the command logs the flag and exits
0instead of failing the workflow that invoked it.
- repomatic.cli.main.log_output_target(subject, output)[source]¶
Log where a command is about to write subject.
Every command that honors an
--outputpath narrates the destination the same way, distinguishing the stdout case (-) so the log names the stream instead of a literal dash.
- class repomatic.cli.main.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]¶
Convert the value to the correct type. This is not called if the value is
None(the missing value).This must accept string values from the command line, as well as values that are already the correct type. It may also convert other compatible types.
The
paramandctxarguments may beNonein certain situations, such as when converting prompt input.If the value cannot be converted, call
fail()with a descriptive message.
- 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.main.AXIS_HEADER_LABELS = {'os': 'OS', 'python-version': 'Python', 'state': 'State'}¶
Display names for the job keys
show-test-matrixheads a row or column with.A key absent from here heads its column under the raw name a matrix declares it as, which is also how a caller names it on the command line.
- repomatic.cli.main.JOB_COUNT_MARK = '×'¶
Introduces the job count of a cell standing for more than one job.
A cell collapses every job at its intersection, so a matrix varying on a third axis renders five jobs exactly like one. The mark is the East Asian Ambiguous U+00D7, like the
—placeholder the grid already uses: a terminal drawing ambiguous characters double-width misaligns both alike, and neither before the other.
- repomatic.cli.main.TEST_MATRIX_STATE_DISPLAY = {'stable': '✅ stable', 'unstable': '⁉️ unstable'}¶
Emoji-decorated labels for job states in the
show-test-matrixgrid.The same two glyphs the workflow templates stamp onto each matrix job’s name, and that
repomatic.github.ci_status.JobStatus.required()reads back off it, so the grid and the CI verdict cannot come to disagree about which mark means “allowed to fail”.Caution
UNSTABLE_GLYPHis an emoji-presentation sequence (U+2049 followed by the U+FE0F selector), and that is the one class of glyph terminals measure differently:wcwidthcounts it as two columns and the table renderer pads to that, while a terminal allocating a single cell for it (Apple Terminal does, painting the glyph over the space that follows) draws the row a column short of its own separators. Carrying the mark CI stamps is worth that, by decision: do not “fix” the alignment by dropping the selector here, which would leave the grid and the job names spelling the mark differently.--no-emojisidesteps the whole question for a reader who wants a square grid, and a terminal on Unicode 9 widths never sees it.
- repomatic.cli.main.matrix_axis_sort_key(axis, matrix_name)[source]¶
Canonical ordering for one grid axis, or
Noneto keep job order.Keyed on which axis it is rather than on which side of the grid it landed: a transposed grid earns the runner order its columns get by default, and reads as arbitrarily shuffled without it. An axis the test matrix does not define an order for (a
click-version) keeps the order the job stream presents it in, which is the matrix author’s own.
- repomatic.cli.main.state_label(state, emoji=True)[source]¶
Label one job state, glyph-decorated unless
emojisays otherwise.A state the matrix carries but this CLI has no label for renders as itself, so a new one shows up in the grid rather than vanishing from it.
- Return type:
- repomatic.cli.main.flat_matrix_table(jobs, leading=(), emoji=True)[source]¶
Lay a solved job stream out as one row per job, one column per key.
A grid has two axes and collapses every other one into its cells, which is what a matrix varying on a third loses. Here each key is a column instead, so nothing collapses and the table is the job list CI will run.
Columns are collected across the whole stream, since a job may carry a key its neighbour does not (the
python-labelonly a prerelease needs), and the state lands last as the outcome the other columns explain. A job missing a key renders empty there rather than shifting its row.- Parameters:
jobs (
Sequence[Mapping[str,str]]) – The solved job stream, already in the order to render.leading (
Sequence[str]) – Keys to column first, in this order, before the ones the stream contributes. A listing sorted on an axis reads as unsorted with that axis buried in the middle, so the caller leads with the axes it ordered by. A key no job carries is skipped rather than columned empty.emoji (
bool) – Label the state with its glyph rather than its bare word.
- Return type:
- Returns:
A
(headers, rows)pair, in the orderprint_tabletakes them the other way round.
- repomatic.cli.main.format_matrix_cell(cell, tally, emoji=True)[source]¶
Render one
show-test-matrixcell from the jobs that landed in it.Every state is labelled on its own. A cell holds more than one when the matrix carries an axis beyond its two (a
click-versionvariation, say): both jobs land on the same intersection, and a label looked up for the joined string would match nothing and leave that cell the only bare one in its column.A state carrying several jobs also states how many, since the grid gives a reader no other way to tell five stable jobs from one.
- Parameters:
cell (
str) – The cellpivot()rendered, returned untouched when no job occupies the intersection: the placeholder for an empty one is that method’s to choose.tally (
Counter[str] |None) – That intersection’s job count per state, orNonewhere the matrix puts no job at all.emoji (
bool) – Label each state with its glyph rather than its bare word. A count is not decoration, and shows either way.
- Return type:
repomatic.cli.release module¶
Release and versioning commands of the repomatic CLI.
One module per help section: every command here registers onto the
repomatic group through the section object both import from
repomatic.cli.main, which pulls this module in at startup.
repomatic.cli.sample module¶
Forge sampling commands of the repomatic CLI.
One module per help section: every command here registers onto the
repomatic group through the section object both import from
repomatic.cli.main, which pulls this module in at startup.
repomatic.cli.setup module¶
Project setup and reporting commands of the repomatic CLI.
One module per help section: every command here registers onto the
repomatic group through the section object both import from
repomatic.cli.main, which pulls this module in at startup.
repomatic.cli.sync module¶
Sync commands of the repomatic CLI.
One module per help section: every command here registers onto the
repomatic group through the section object both import from
repomatic.cli.main, which pulls this module in at startup.