Skip to content

Commit a6f9650

Browse files
committed
correct handling of the publish flag.
1 parent 25d191e commit a6f9650

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

tools/yaml2x/yaml2json/yaml2json.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from a11y_guidelines import setup_instances, InfoRef, Check
1515
import config, utils, rst_processor
1616

17-
def get_yaml_data(basedir: Path, base_url: str) -> Dict[str, Any]:
17+
def get_yaml_data(basedir: Path, base_url: str, publish: bool = False) -> Dict[str, Any]:
1818
"""
1919
Process YAML files and return structured data as a Python dictionary.
2020
@@ -29,7 +29,12 @@ def get_yaml_data(basedir: Path, base_url: str) -> Dict[str, Any]:
2929
Exception: If there's an error during the conversion process
3030
"""
3131
# Initialize configuration
32-
settings: Dict[str, Any] = {"basedir": basedir, "base_url": base_url}
32+
settings: Dict[str, Any] = {
33+
"basedir": basedir,
34+
"base_url": base_url,
35+
"publish": publish
36+
}
37+
3338
version_info: Dict[str, str] = utils.get_version_info(basedir)
3439
setup_instances(basedir)
3540

@@ -50,7 +55,7 @@ def get_yaml_data(basedir: Path, base_url: str) -> Dict[str, Any]:
5055

5156
# Return output data
5257
return {
53-
'publish': settings.get('publish', True),
58+
'publish': publish,
5459
'version': version_info['checksheet_version'],
5560
'date': version_info['checksheet_date'],
5661
'checks': checks
@@ -65,7 +70,7 @@ def main() -> None:
6570
settings: Dict[str, Any] = config.setup_configuration()
6671

6772
# Process YAML data
68-
output_data = get_yaml_data(settings['basedir'], settings['base_url'])
73+
output_data = get_yaml_data(settings['basedir'], settings['base_url'], settings['publish'])
6974

7075
# Write to JSON file
7176
with open(settings['output_file'], mode="w", encoding="utf-8", newline="\n") as f:

0 commit comments

Comments
 (0)