Skip to content

Improve error reporting when a config is malformed #175

@ymyzk

Description

@ymyzk

Problem
When a given configuration is malformed (: must be used instead of =) like the following example (#174)

python =
    3.7 = py37
    3.8 = py38
...

tox-gh-actions reports user-unfriendly error like

return {k: StrConvert.to_env_list(v).envs for k, v in parse_dict(value).items()}
File "/opt/hostedtoolcache/Python/3.9.16/x64/lib/python3.9/site-packages/tox_gh_actions/plugin.py", line 264, in parse_dict
return dict((k.strip(), v.strip()) for k, v in pairs)
File "/opt/hostedtoolcache/Python/3.9.16/x64/lib/python3.9/site-packages/tox_gh_actions/plugin.py", line 264, in <genexpr>
return dict((k.strip(), v.strip()) for k, v in pairs)
ValueError: not enough values to unpack (expected 2, got 1)
Error: Process completed with exit code 1.

Idea
It's better to detect malformed configurations and show user-friendly error messages instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions