Repository navigation
fix(deprecation): emit [[pre-*]] blocks when migrating table form - #2151
Merged
Merged
Conversation
The pre-* table form migration produced an inline pipeline
(`pre-merge = [{ test = "..." }, { lint = "..." }]`), which packed every
named step onto one long line. Users reviewing the generated `.new`
file had to eyeball a dense value instead of reading block-structured
TOML that mirrors the source they wrote.
Emit `toml_edit::ArrayOfTables` so each step becomes its own
`[[pre-merge]]` block — the same block form taught for
`[[aliases.NAME]]` in 3f44cb5. Iterate keys in document order and
replace the item in place via `get_mut` so migrated sections stay where
they were instead of being appended after unrelated sections.
Co-Authored-By: Claude <[email protected]>
# Conflicts: # tests/snapshots/integration__integration_tests__config_show__config_show_displays_pre_hook_table_form_deprecation.snap
worktrunk-bot
approved these changes
Apr 13, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
[[pre-merge]]array-of-tables blocks instead of an inlinepre-merge = [{...}, {...}]pipeline, matching the block form taught in docs(aliases): teach [[aliases.NAME]] pipeline blocks #2144 for[[aliases.NAME]].get_mutrather thanremove+insert(which appended at the end).Generated diff before/after:
Test plan
cargo test --lib config::deprecation(139 passed)cargo test --test integration config_show(97 passed)snapshot_migrate_pre_hook_table_form,config_show_displays_pre_hook_table_form_deprecation)