Skip to content

Commit 20c6f40

Browse files
committed
fix: support tox-gh and similar plugins
Signed-off-by: Henry Schreiner <[email protected]>
1 parent 399089a commit 20c6f40

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/tox/config/main.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,9 @@ def core(self) -> CoreConfigSet:
123123
self._core_set = core
124124
return core
125125

126+
def all_section_configs(self) -> Iterator[tuple[tuple[str, str, str], ConfigSet]]:
127+
yield from self._key_to_conf_set.items()
128+
126129
def get_section_config(
127130
self,
128131
section: Section,

src/tox/session/cmd/schema.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,18 @@ def gen_schema(state: State) -> int:
9999

100100
properties = _get_schema(core, path="#/properties")
101101

102+
sections = {
103+
key: conf
104+
for s, conf in state.conf.all_section_configs()
105+
if (key := s[0].split(".")[0]) not in {"env_run_base", "env_pkg_base", "env"}
106+
}
107+
for key, conf in sections.items():
108+
properties[key] = {
109+
"type": "object",
110+
"additionalProperties": not strict,
111+
"properties": _get_schema(conf, path=f"#/properties/{key}/properties"),
112+
}
113+
102114
json_schema = {
103115
"$schema": "http://json-schema.org/draft-07/schema",
104116
"$id": "https://github.com/tox-dev/tox/blob/main/src/tox/util/tox.schema.json",

0 commit comments

Comments
 (0)