fix(init): normalize node runtime before linters#267
Merged
zeitlinger merged 2 commits intomainfrom May 6, 2026
Merged
Conversation
Signed-off-by: Gregor Zeitlinger <[email protected]>
Contributor
There was a problem hiding this comment.
Pull request overview
Adjusts the flint init write flow so that when an npm: backend tool (e.g., npm:renovate) is selected, the required node runtime is inserted before [tools] normalization—keeping node grouped with runtime tools above the # Linters block in generated mise.toml.
Changes:
- Call
ensure_node_for_npm(project_root)beforenormalize_tools_section(&mise_path)duringinit. - Include
node_addedin the “No changes to apply.” noop decision. - Add a unit test intended to validate node placement relative to the linters header for
npm:tools.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/init/mod.rs |
Reorders init steps to ensure node is added prior to [tools] normalization and updates noop detection. |
src/init/tests.rs |
Adds a test around npm:renovate + ensure_node_for_npm + normalization to assert node remains above # Linters. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Gregor Zeitlinger <[email protected]>
martincostello
approved these changes
May 6, 2026
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.
What changed
This updates
flint initso thenoderuntime is added before[tools]normalization when annpm:backend tool such asnpm:renovateis selected.Why
initalready ensurednodeindirectly through the later migration pass, but that happened after[tools]normalization. The result was a validmise.tomlwithnodeappended under the# Lintersblock instead of being grouped with runtime tools above it.Impact
Generated
mise.tomlfiles now keepnodein the runtime section while still adding it automatically fornpm:tools.Root cause
The init flow normalized
[tools]before calling the helper that insertsnode, so the final write order was wrong even though the dependency was present.Validation
cargo test init::tests::node_added_for_npm_tools_is_normalized_above_linters_header -- --exactcargo test init::tests::normalize_tools_section_moves_node_above_linters_header -- --exactcargo test init::tests::compute_desired_tools_comprehensive_includes_slow -- --exactmise run lint:fix