fix(config): preserve TOML table indentation
CI / Capabilities and shell quality (push) Successful in 12s
CI / Python tests and compilation (push) Successful in 22s
CI / CI configuration security checks (push) Successful in 4s
CI / Build and inspect generated packages (push) Successful in 13s
CI / PowerShell tests on Ubuntu (push) Failing after 55s
CI / Bash integration and installation guards (push) Failing after 16s
CI / Installed client configuration smoke tests (push) Successful in 14s
CI / Qwen retrieval integration (push) Canceled after 6m14s

This commit is contained in:
Julian lechner committed 2026-09-30 10:33:51 +02:00
1 parent 1b13bed418
commit 6ab92ec30e
2 files changed
+17 -2

No files matched your search

+2 -2
View File
@@ -152,7 +152,7 @@ def merge_toml(current_text, managed_text, statusline_enabled=True):
result = ''.join(managed_root).rstrip()
if root_extras:
result += '\n' + ''.join(root_extras).strip()
result += '\n' + ''.join(root_extras).strip('\r\n')
result += '\n'
for header, block in managed_sections:
result += ''.join(block)
@@ -161,7 +161,7 @@ def merge_toml(current_text, managed_text, statusline_enabled=True):
if not result.endswith('\n\n'):
result += '\n'
if extras:
result = result.rstrip() + '\n\n' + ''.join(extras).lstrip()
result = result.rstrip() + '\n\n' + ''.join(extras).lstrip('\r\n')
tomllib.loads(result)
return result
+15
View File
@@ -16,6 +16,21 @@ SPEC.loader.exec_module(OPTIONS)
class InstallOptionsTests(unittest.TestCase):
def test_merge_toml_preserves_local_plugin_table_indentation(self):
plugin_state = (' [marketplaces.ponytail]\n'
' source_type = "git"\n'
' source = "https://github.com/DietrichGebert/ponytail.git"\n'
' [plugins."ponytail@ponytail"]\n'
' enabled = true\n'
' [plugins."disabled@market"]\n'
' enabled = false')
current = "model = 'old'\napprovals_reviewer = 'user'\n" + plugin_state + '\n'
managed = "approvals_reviewer = 'auto_review'\n\n[tui]\n"
result = OPTIONS.merge_toml(current, managed)
self.assertIn(plugin_state, result)
def test_filter_preserves_other_claude_hooks_and_status(self):
with tempfile.TemporaryDirectory() as directory:
path = Path(directory) / 'settings.json'