Skip to content

Commit

Permalink
FIX: replace testenv: with proper TOML table name (#482)
Browse files Browse the repository at this point in the history
* FIX: prepend `tool.tox.env.` before base value
* FIX: replace `testenv:` in str value
  • Loading branch information
redeboer authored Jan 8, 2025
1 parent 0205d87 commit d4a4e75
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/compwa_policy/check_dev_files/tox.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,13 @@ def __convert_ini_dict(ini: Mapping[str, str]) -> dict[str, Any]:
if key == "commands":
value = ___convert_commands(ini_value, value)
# cspell:ignore passenv
if key in {"base", "pass_env"} and isinstance(value, str):
value = [value]
if isinstance(value, str):
if key == "base":
value = f"tool.tox.env.{value}"
if "testenv:" in value:
value = value.replace("testenv:", "tool.tox.env.")
if key in {"base", "pass_env"}:
value = [value]
toml[key] = value
return toml

Expand Down

0 comments on commit d4a4e75

Please sign in to comment.