Skip to content

Commit d037ddb

Browse files
committed
feat: allow expression for str options, better handling of tag:<pattern>, name:<pattern> options
1 parent dd6d758 commit d037ddb

File tree

19 files changed

+2391
-984
lines changed

19 files changed

+2391
-984
lines changed

.vscode/launch.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@
4747
// "env": {
4848
// "ROBOTCODE_COLOR": "1",
4949
// },
50+
"env": {
51+
"CMD_VAR_LONG": "long",
52+
},
5053
"args": [
5154
"--verbose",
5255
"--dry",
@@ -63,8 +66,9 @@
6366
// "list",
6467
// "--format",
6568
// "toml"
66-
"rebot",
67-
69+
"profiles",
70+
"show",
71+
"--no-evaluate"
6872
]
6973
},
7074
{

etc/robot.toml.json

Lines changed: 1802 additions & 504 deletions
Large diffs are not rendered by default.

packages/core/robotcode/core/dataclasses.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -324,11 +324,20 @@ def from_dict(
324324
return cast(_T, v)
325325

326326
raise TypeError(
327-
f"Cant convert value {repr(value)} of type {type(value).__name__} to type " + repr(types[0])
328-
if len(types) == 1
329-
else " | ".join(
330-
((getattr(e, "__name__", None) or str(e) if e is not type(None) else "None") if e is not None else "None")
331-
for e in types
327+
f"Cant convert value {repr(value)} of type {type(value).__name__} to type(s) "
328+
+ (
329+
repr(types[0])
330+
if len(types) == 1
331+
else " | ".join(
332+
(
333+
(getattr(e, "__name__", None) or str(e) if e is not type(None) else "None")
334+
if get_origin(e) is not Literal
335+
else repr(e).replace("typing.", "")
336+
if e is not None
337+
else "None"
338+
)
339+
for e in types
340+
)
332341
)
333342
+ "."
334343
)

packages/plugin/robotcode/plugin/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def __str__(self) -> str:
3333

3434
@dataclass
3535
class CommonConfig:
36-
config_file: Optional[Path] = None
36+
config_files: Optional[List[Path]] = None
3737
profiles: Optional[List[str]] = None
3838
dry: bool = False
3939
verbose: bool = False

packages/robot/robotcode/robot/config/loader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def _load_config_data_from_path(__path: Path) -> RobotConfig:
5252
if __path.name == ROBOT_TOML or __path.name == LOCAL_ROBOT_TOML:
5353
return loads_config_from_robot_toml(__path.read_text("utf-8"))
5454

55-
raise ValueError(f"Unknown config file name: {__path.name}")
55+
raise ValueError(f"Unknown config file type: {__path.name}")
5656

5757

5858
def load_config_from_path(*__paths: Union[Path, Tuple[Path, ConfigType]]) -> RobotConfig:

0 commit comments

Comments
 (0)