Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions project_forge/context_builder/data_merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import copy
import logging
from collections import OrderedDict
from functools import reduce
from itertools import chain
from typing import Any, Iterable, Literal, MutableMapping, TypeVar, overload

Expand Down Expand Up @@ -104,7 +103,7 @@ def merge_into(d1: dict, d2: dict) -> dict:

match left_val, right_val:
case (dict(), dict()):
return reduce(merge_into, (left_val, right_val), {}) # type: ignore[return-value]
return merge_into(copy.deepcopy(left_val), right_val) # type: ignore[return-value]
case _:
return right_val

Expand Down
2 changes: 1 addition & 1 deletion project_forge/models/composition.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Composition(BaseModel):
default_factory=dict,
description=(
"Merge the values of one or more keys in a specific way. This is useful for `yaml` or `json` values. "
"Valid merge methods are `update` and `comprehensive`."
"Valid merge methods are `update`, `nested-overwrite`, and `comprehensive`."
),
)
extra_context: dict = Field(
Expand Down
2 changes: 1 addition & 1 deletion project_forge/rendering/templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def catalog_templates(template_path: Path, process_mode_func: ProcessModeFn) ->
dir_path = root / dir_
process_mode = process_mode_func(dir_path)
templates[str(dir_path.relative_to(root_dir).as_posix())] = TemplateFile(dir_path, process_mode)
return {key: templates[key] for key in sorted(templates)}
return dict(sorted(templates.items()))


class InheritanceMap(ChainMap[str, TemplateFile]):
Expand Down
Loading