Skip to content

Commit 48cb64c

Browse files
committed
fix(robotcode): add missing profile settings to config documentation
1 parent ca2eb58 commit 48cb64c

File tree

2 files changed

+110
-9
lines changed

2 files changed

+110
-9
lines changed

docs/cli/config.md

Lines changed: 99 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,40 @@
1+
## [profile].description
2+
3+
Type: Optional[str]
4+
5+
Description of the profile.
6+
7+
## [profile].detached
8+
9+
Type: Optional[bool]
10+
11+
The profile should be detached."
12+
Detached means it is not inherited from the main profile.
13+
14+
## [profile].enabled
15+
16+
Type: Union[bool, Condition, None]
17+
18+
If enabled the profile is used. You can also use and `if` condition
19+
to calculate the enabled state.
20+
21+
Examples:
22+
```toml
23+
# alway disabled
24+
enabled = false
25+
```
26+
27+
```toml
28+
# enabled if TEST_VAR is set
29+
enabled = { if = 'environ.get("CI") == "true"' }
30+
```
31+
32+
## [profile].precedence
33+
34+
Type: Optional[int]
35+
36+
Precedence of the profile. Lower values are executed first. If not set the order is undefined.
37+
138
## args
239

340
Type: Optional[List[str]]
@@ -319,6 +356,21 @@ as --doc. Example: --metadata Version:1.2
319356

320357
corresponds to the `-M --metadata name:value *` option of _robot_
321358

359+
## extra-parse-include
360+
361+
Type: Optional[List[Union[str, StringExpression]]]
362+
363+
Appends entries to the --parseinclude option.
364+
365+
Parse only files matching `pattern`. It can be:
366+
- a file name or pattern like `example.robot` or
367+
`*.robot` to parse all files matching that name,
368+
- a file path like `path/to/example.robot`, or
369+
- a directory path like `path/to/example` to parse
370+
all files in that directory, recursively.
371+
372+
corresponds to the `-I --parseinclude pattern *` option of _robot_
373+
322374
## extra-parsers
323375

324376
Type: Optional[Dict[str, List[Union[str, StringExpression]]]]
@@ -633,9 +685,9 @@ powerful variable setting mechanism.
633685
Examples:
634686

635687
```
636-
--variable str:Hello => ${str} = `Hello`
637-
-v hi:Hi_World -E space:_ => ${hi} = `Hi World`
638-
-v x: -v y:42 => ${x} = ``, ${y} = `42`
688+
--variable name:Robot => ${name} = `Robot`
689+
-v "hello:Hello world" => ${hello} = `Hello world`
690+
-v x: -v y:42 => ${x} = ``, ${y} = `42`
639691
```
640692

641693
corresponds to the `-v --variable name:value *` option of _rebot_
@@ -914,6 +966,19 @@ is considered relative to that unless it is absolute.
914966

915967
corresponds to the `-d --outputdir dir` option of _robot_
916968

969+
## parse-include
970+
971+
Type: Optional[List[Union[str, StringExpression]]]
972+
973+
Parse only files matching `pattern`. It can be:
974+
- a file name or pattern like `example.robot` or
975+
`*.robot` to parse all files matching that name,
976+
- a file path like `path/to/example.robot`, or
977+
- a directory path like `path/to/example` to parse
978+
all files in that directory, recursively.
979+
980+
corresponds to the `-I --parseinclude pattern *` option of _robot_
981+
917982
## parsers
918983

919984
Type: Optional[Dict[str, List[Union[str, StringExpression]]]]
@@ -1193,6 +1258,21 @@ as --doc. Example: --metadata Version:1.2
11931258

11941259
corresponds to the `-M --metadata name:value *` option of _robot_
11951260

1261+
## rebot.extra-parse-include
1262+
1263+
Type: Optional[List[Union[str, StringExpression]]]
1264+
1265+
Appends entries to the --parseinclude option.
1266+
1267+
Parse only files matching `pattern`. It can be:
1268+
- a file name or pattern like `example.robot` or
1269+
`*.robot` to parse all files matching that name,
1270+
- a file path like `path/to/example.robot`, or
1271+
- a directory path like `path/to/example` to parse
1272+
all files in that directory, recursively.
1273+
1274+
corresponds to the `-I --parseinclude pattern *` option of _robot_
1275+
11961276
## rebot.extra-pre-rebot-modifiers
11971277

11981278
Type: Optional[Dict[str, List[Union[str, StringExpression]]]]
@@ -1553,6 +1633,19 @@ is considered relative to that unless it is absolute.
15531633

15541634
corresponds to the `-d --outputdir dir` option of _robot_
15551635

1636+
## rebot.parse-include
1637+
1638+
Type: Optional[List[Union[str, StringExpression]]]
1639+
1640+
Parse only files matching `pattern`. It can be:
1641+
- a file name or pattern like `example.robot` or
1642+
`*.robot` to parse all files matching that name,
1643+
- a file path like `path/to/example.robot`, or
1644+
- a directory path like `path/to/example` to parse
1645+
all files in that directory, recursively.
1646+
1647+
corresponds to the `-I --parseinclude pattern *` option of _robot_
1648+
15561649
## rebot.pre-rebot-modifiers
15571650

15581651
Type: Optional[Dict[str, List[Union[str, StringExpression]]]]
@@ -2318,9 +2411,9 @@ powerful variable setting mechanism.
23182411
Examples:
23192412

23202413
```
2321-
--variable str:Hello => ${str} = `Hello`
2322-
-v hi:Hi_World -E space:_ => ${hi} = `Hi World`
2323-
-v x: -v y:42 => ${x} = ``, ${y} = `42`
2414+
--variable name:Robot => ${name} = `Robot`
2415+
-v "hello:Hello world" => ${hello} = `Hello world`
2416+
-v x: -v y:42 => ${x} = ``, ${y} = `42`
23242417
```
23252418

23262419
corresponds to the `-v --variable name:value *` option of _robot_
@@ -2333,5 +2426,3 @@ xUnit compatible result file. Not created unless this
23332426
option is specified.
23342427

23352428
corresponds to the `-x --xunit file` option of _robot_
2336-
2337-

src/robotcode/cli/commands/config.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
find_project_root,
1313
load_config_from_path,
1414
)
15-
from robotcode.robot.config.model import LibDocProfile, RebotProfile, RobotConfig, TestDocProfile
15+
from robotcode.robot.config.model import LibDocProfile, RebotProfile, RobotConfig, RobotProfile, TestDocProfile
1616
from robotcode.robot.config.utils import get_config_files
1717

1818

@@ -178,6 +178,16 @@ def get_config_fields() -> Dict[str, Dict[str, str]]:
178178
"description": field.metadata.get("description", "").strip(),
179179
}
180180

181+
for field in dataclasses.fields(RobotProfile):
182+
field_name_encoded = encode_case(RobotProfile, field)
183+
if field_name_encoded in result:
184+
continue
185+
186+
result["[profile]." + field_name_encoded] = {
187+
"type": str(field.type),
188+
"description": field.metadata.get("description", "").strip(),
189+
}
190+
181191
for field in dataclasses.fields(RebotProfile):
182192
field_name_encoded = encode_case(RebotProfile, field)
183193
result["rebot." + field_name_encoded] = {

0 commit comments

Comments
 (0)