Skip to content

Commit a7ef8bc

Browse files
committed
feat(discover): robotcode discover TEXT output is now markdown
`robotcode discover` subcommands now emit markdown for human output. On a coloured TTY rich renders it to themed ANSI and pages if needed; in a pipe (or with --no-color) the raw markdown is emitted verbatim. JSON output is unchanged. - info renders as a field/value table. - files, suites, tests, tasks emit as bullet lists; tags shows one bullet per tag with nested tests/tasks when --tests / --tasks is on. - all keeps the workspace → suites → tests tree as a nested markdown list, each level indented two spaces. - Statistics blocks are markdown tables. The generic markdown helpers used by results — md_table, bold_status, path_paren, display_width, the search highlighter — move from `results/_render.py` to a shared `cli/_markdown.py` so both commands import them from one place. Same commit aligns the existing results renderer on the new label convention: **bold** is reserved for entities (test/suite /tag names, status); _italic_ marks labels (Tags, Total, Extracted, Summary, metadata keys); `(path:line)` references are wrapped in inline-code spans so they read as code tokens.
1 parent 4b94d66 commit a7ef8bc

13 files changed

Lines changed: 1138 additions & 501 deletions

File tree

docs/03_reference/cli.md

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1030,6 +1030,11 @@ robotcode discover all [OPTIONS] [ROBOT_OPTIONS_AND_ARGS]...
10301030
Show the tags that are present. [default: tags]
10311031

10321032

1033+
- `--version`
1034+
1035+
Show the version and exit.
1036+
1037+
10331038
- `-ebl, --exclude-by-longname TEXT *`
10341039

10351040
Excludes tests/tasks or suites by longname.
@@ -1040,11 +1045,6 @@ robotcode discover all [OPTIONS] [ROBOT_OPTIONS_AND_ARGS]...
10401045
Select tests/tasks or suites by longname.
10411046

10421047

1043-
- `--version`
1044-
1045-
Show the version and exit.
1046-
1047-
10481048
- `--search TEXT`
10491049

10501050
Only include items where TEXT case-insensitively matches the name, full name, source path, documentation, template name, timeout, any tag (normalisation-aware), the parent suite's Documentation / Metadata, or anything inside the test body — keyword names, keyword arguments, assigned variables, FOR/WHILE/IF conditions, VAR/RETURN values, EXCEPT patterns, GROUP names. Mutually exclusive with `--search-regex`.
@@ -1149,6 +1149,11 @@ robotcode discover suites [OPTIONS] [ROBOT_OPTIONS_AND_ARGS]...
11491149

11501150

11511151
**Options:**
1152+
- `--version`
1153+
1154+
Show the version and exit.
1155+
1156+
11521157
- `-ebl, --exclude-by-longname TEXT *`
11531158

11541159
Excludes tests/tasks or suites by longname.
@@ -1159,11 +1164,6 @@ robotcode discover suites [OPTIONS] [ROBOT_OPTIONS_AND_ARGS]...
11591164
Select tests/tasks or suites by longname.
11601165

11611166

1162-
- `--version`
1163-
1164-
Show the version and exit.
1165-
1166-
11671167
- `--search TEXT`
11681168

11691169
Only include items where TEXT case-insensitively matches the name, full name, source path, documentation, template name, timeout, any tag (normalisation-aware), the parent suite's Documentation / Metadata, or anything inside the test body — keyword names, keyword arguments, assigned variables, FOR/WHILE/IF conditions, VAR/RETURN values, EXCEPT patterns, GROUP names. Mutually exclusive with `--search-regex`.
@@ -1231,6 +1231,11 @@ robotcode discover tags [OPTIONS] [ROBOT_OPTIONS_AND_ARGS]...
12311231
Show full paths instead of relative. [default: no-full-paths]
12321232

12331233

1234+
- `--version`
1235+
1236+
Show the version and exit.
1237+
1238+
12341239
- `-ebl, --exclude-by-longname TEXT *`
12351240

12361241
Excludes tests/tasks or suites by longname.
@@ -1241,11 +1246,6 @@ robotcode discover tags [OPTIONS] [ROBOT_OPTIONS_AND_ARGS]...
12411246
Select tests/tasks or suites by longname.
12421247

12431248

1244-
- `--version`
1245-
1246-
Show the version and exit.
1247-
1248-
12491249
- `--search TEXT`
12501250

12511251
Only include items where TEXT case-insensitively matches the name, full name, source path, documentation, template name, timeout, any tag (normalisation-aware), the parent suite's Documentation / Metadata, or anything inside the test body — keyword names, keyword arguments, assigned variables, FOR/WHILE/IF conditions, VAR/RETURN values, EXCEPT patterns, GROUP names. Mutually exclusive with `--search-regex`.
@@ -1298,6 +1298,11 @@ robotcode discover tasks [OPTIONS] [ROBOT_OPTIONS_AND_ARGS]...
12981298
Show full paths instead of relative. [default: no-full-paths]
12991299

13001300

1301+
- `--version`
1302+
1303+
Show the version and exit.
1304+
1305+
13011306
- `-ebl, --exclude-by-longname TEXT *`
13021307

13031308
Excludes tests/tasks or suites by longname.
@@ -1308,11 +1313,6 @@ robotcode discover tasks [OPTIONS] [ROBOT_OPTIONS_AND_ARGS]...
13081313
Select tests/tasks or suites by longname.
13091314

13101315

1311-
- `--version`
1312-
1313-
Show the version and exit.
1314-
1315-
13161316
- `--search TEXT`
13171317

13181318
Only include items where TEXT case-insensitively matches the name, full name, source path, documentation, template name, timeout, any tag (normalisation-aware), the parent suite's Documentation / Metadata, or anything inside the test body — keyword names, keyword arguments, assigned variables, FOR/WHILE/IF conditions, VAR/RETURN values, EXCEPT patterns, GROUP names. Mutually exclusive with `--search-regex`.
@@ -1365,6 +1365,11 @@ robotcode discover tests [OPTIONS] [ROBOT_OPTIONS_AND_ARGS]...
13651365
Show full paths instead of relative. [default: no-full-paths]
13661366

13671367

1368+
- `--version`
1369+
1370+
Show the version and exit.
1371+
1372+
13681373
- `-ebl, --exclude-by-longname TEXT *`
13691374

13701375
Excludes tests/tasks or suites by longname.
@@ -1375,11 +1380,6 @@ robotcode discover tests [OPTIONS] [ROBOT_OPTIONS_AND_ARGS]...
13751380
Select tests/tasks or suites by longname.
13761381

13771382

1378-
- `--version`
1379-
1380-
Show the version and exit.
1381-
1382-
13831383
- `--search TEXT`
13841384

13851385
Only include items where TEXT case-insensitively matches the name, full name, source path, documentation, template name, timeout, any tag (normalisation-aware), the parent suite's Documentation / Metadata, or anything inside the test body — keyword names, keyword arguments, assigned variables, FOR/WHILE/IF conditions, VAR/RETURN values, EXCEPT patterns, GROUP names. Mutually exclusive with `--search-regex`.
@@ -2453,6 +2453,11 @@ robotcode robot [OPTIONS] [ROBOT_OPTIONS_AND_ARGS]...
24532453

24542454

24552455
**Options:**
2456+
- `--version`
2457+
2458+
Show the version and exit.
2459+
2460+
24562461
- `-ebl, --exclude-by-longname TEXT *`
24572462

24582463
Excludes tests/tasks or suites by longname.
@@ -2463,11 +2468,6 @@ robotcode robot [OPTIONS] [ROBOT_OPTIONS_AND_ARGS]...
24632468
Select tests/tasks or suites by longname.
24642469

24652470

2466-
- `--version`
2467-
2468-
Show the version and exit.
2469-
2470-
24712471
- `--help`
24722472

24732473
Show this message and exit.

docs/03_reference/discovering-tests.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,7 @@ An unparseable regex (e.g. `[unclosed`) yields a usage error pinpointing where t
350350

351351
## Tips for terminal use
352352

353+
- **TEXT output is markdown.** On a coloured TTY the markdown is rendered to themed ANSI via `rich` (and paged if longer than your terminal); on pipes or with `--no-color` the raw markdown goes through verbatim — paste it into a PR description, a Slack message, or feed it straight to an LLM.
353354
- **Quote your globs.** `--suite "*.Login.*"` and `--test "Test ?"` need quotes so the shell doesn't expand them against the local filesystem first.
354355
- **`-bl` is for exact names, `-t` is for patterns.** When you copy a test long-name out of another tool's output, `-bl` is usually what you want — no need to escape glob characters.
355356
- **Pre-filter before piping into `robot`.** `robotcode discover tests --include smoke -f json | jq -r '.items[].longname'` gives you a stable list of long names you can hand back to `robotcode robot -bl ...` for sharded CI runs.

0 commit comments

Comments
 (0)