Skip to content

Commit bc26a9a

Browse files
authored
[BREAKING] update pyproject label to tool.render-engine (#12)
* [BREAKING] update pyproject label to tool.render-engine * ruff lint
1 parent c5cb1a7 commit bc26a9a

File tree

3 files changed

+500
-491
lines changed

3 files changed

+500
-491
lines changed

src/render_engine_cli/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def load_config(self, config_file: str = CONFIG_FILE_NAME):
4848
try:
4949
with open(config_file) as stored_config_file:
5050
try:
51-
stored_config = toml.load(stored_config_file).get("render-engine", {}).get("cli", {})
51+
stored_config = toml.load(stored_config_file).get("tool.render-engine", {}).get("cli", {})
5252
except TomlDecodeError as exc:
5353
click.echo(f"Encountered an error while parsing {config_file} - {exc}.")
5454
else:

tests/test_cli.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,10 @@ def test_collection_call_with_content():
8181
[
8282
(["key1=value1", "key2=value2"], {"key1": "value1", "key2": "value2"}),
8383
(["key1:value1", "key2:value2"], {"key1": "value1", "key2": "value2"}),
84-
(["author=John Doe", "tags:python,testing"], {"author": "John Doe", "tags": "python,testing"}),
84+
(
85+
["author=John Doe", "tags:python,testing"],
86+
{"author": "John Doe", "tags": "python,testing"},
87+
),
8588
([], {}),
8689
(None, {}),
8790
],
@@ -103,7 +106,9 @@ def test_split_args_error_handling():
103106

104107
def test_config_loading_with_valid_config(tmp_path, monkeypatch):
105108
"""Tests config loading from pyproject.toml (2025.5.1b1 feature)"""
106-
config_content = {"render-engine": {"cli": {"module": "myapp", "site": "MySite", "collection": "MyCollection"}}}
109+
config_content = {
110+
"tool.render-engine": {"cli": {"module": "myapp", "site": "MySite", "collection": "MyCollection"}}
111+
}
107112

108113
config_file = tmp_path / "pyproject.toml"
109114
config_file.write_text(toml.dumps(config_content))
@@ -145,7 +150,10 @@ def test_collection_entry_with_custom_attributes():
145150
"""Tests that custom attributes are passed through to collection entry"""
146151
test_collection = Collection()
147152
content = create_collection_entry(
148-
content="Test content", collection=test_collection, author="Test Author", tags="test,example"
153+
content="Test content",
154+
collection=test_collection,
155+
author="Test Author",
156+
tags="test,example",
149157
)
150158
post = frontmatter.loads(content)
151159

0 commit comments

Comments
 (0)