Skip to content

Commit 7098156

Browse files
committed
fix: filter out internal fields and ensure style is exported as string in configuration
1 parent 93ce0f5 commit 7098156

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/repomix/cli/actions/init_action.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,11 @@ def run_init_action(cwd: str | Path, use_global: bool = False) -> None:
4141
config = RepomixConfig()
4242

4343
# Convert configuration to serializable dictionary
44-
output_dict = config.output.__dict__.copy()
45-
# Convert _style to style for better readability in config file
46-
if "_style" in output_dict:
47-
output_dict["style"] = output_dict.pop("_style").value
44+
# Get only public fields, excluding internal fields that start with underscore
45+
output_dict = {k: v for k, v in config.output.__dict__.items() if not k.startswith('_')}
46+
# Ensure style is exported as string value
47+
if hasattr(config.output, 'style_enum'):
48+
output_dict["style"] = config.output.style_enum.value
4849

4950
config_dict = {
5051
"remote": config.remote.__dict__,

0 commit comments

Comments
 (0)