chore: sort settings.toml alphabetically and add test#8111
Conversation
Summary of ChangesHello @jdx, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request focuses on enhancing the consistency and maintainability of the project's configuration. By alphabetically sorting the Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Pull request overview
This PR reorganizes settings.toml by sorting settings sections alphabetically and adds a unit test to enforce ordering going forward.
Changes:
- Reordered
settings.tomlsections into alphabetical order (including moved blocks likeage.*,conda.channel,locked,terminal_progress, etc.). - Added
test_settings_toml_is_sortedto assertsettings.tomlremains alphabetically ordered.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/config/settings.rs | Adds a unit test intended to enforce alphabetical ordering of settings keys. |
| settings.toml | Reorders settings definitions/sections alphabetically to keep the file organized. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| let content = | ||
| std::fs::read_to_string(concat!(env!("CARGO_MANIFEST_DIR"), "/settings.toml")) | ||
| .expect("failed to read settings.toml"); | ||
| let table: toml::Table = content.parse().expect("failed to parse settings.toml"); | ||
|
|
||
| fn collect_keys(table: &toml::Table, prefix: &str) -> Vec<String> { | ||
| let mut keys = Vec::new(); | ||
| for (key, value) in table { | ||
| let full_key = if prefix.is_empty() { | ||
| key.clone() | ||
| } else { | ||
| format!("{prefix}.{key}") | ||
| }; | ||
| if let toml::Value::Table(sub) = value { | ||
| // A nested table that has no "type" or "description" is a grouping table | ||
| // (e.g., [aqua], [node]), not a setting itself. | ||
| if !sub.contains_key("type") && !sub.contains_key("description") { | ||
| keys.extend(collect_keys(sub, &full_key)); | ||
| continue; | ||
| } | ||
| } | ||
| keys.push(full_key); | ||
| } | ||
| keys | ||
| } | ||
|
|
||
| let keys = collect_keys(&table, ""); | ||
| let mut sorted = keys.clone(); | ||
| sorted.sort(); |
There was a problem hiding this comment.
The test currently parses TOML into toml::Table and then iterates the map to obtain keys. The toml crate’s table/map iteration order is not the same as “order in the source file” (and is commonly key-sorted), so this test is likely to pass even when settings.toml is not sorted on disk. To actually enforce file ordering, derive the key/header sequence from the raw file text using an order-preserving parser (e.g., toml_edit) or by scanning lines for table headers/setting identifiers and comparing that encountered sequence against a sorted copy.
| if let toml::Value::Table(sub) = value { | ||
| // A nested table that has no "type" or "description" is a grouping table | ||
| // (e.g., [aqua], [node]), not a setting itself. | ||
| if !sub.contains_key("type") && !sub.contains_key("description") { | ||
| keys.extend(collect_keys(sub, &full_key)); | ||
| continue; | ||
| } | ||
| } |
There was a problem hiding this comment.
The “grouping table” detection is based on the absence of "type" and "description", which is a schema-dependent heuristic. If a legitimate setting table ever omits one/both of these fields, it will be treated as a grouping table and won’t be checked by the sort assertion. Consider making grouping detection explicit (e.g., by enumerating known grouping roots) or using a more robust schema signal so the test cannot silently skip settings.
There was a problem hiding this comment.
Code Review
This PR does a good job of sorting the settings.toml file and adding a test to enforce it. I found a couple of entries that are out of alphabetical order. The new test should have caught these, so I'm not sure why it's passing, but the sorting should be corrected. Otherwise, this is a great change for maintainability.
| type = "Bool" | ||
|
|
||
| [slsa] | ||
| [github_attestations] |
| hide = true | ||
| type = "Bool" | ||
|
|
||
| [locked] |
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1ed985b to
aa1dfdb
Compare
Hyperfine Performance
|
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.2.9 x -- echo |
22.3 ± 0.4 | 21.4 | 24.6 | 1.00 |
mise x -- echo |
23.2 ± 0.5 | 22.1 | 24.9 | 1.04 ± 0.03 |
mise env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.2.9 env |
21.9 ± 0.6 | 20.9 | 26.5 | 1.00 |
mise env |
22.6 ± 0.5 | 21.6 | 24.2 | 1.03 ± 0.04 |
mise hook-env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.2.9 hook-env |
22.4 ± 0.5 | 21.2 | 27.8 | 1.00 |
mise hook-env |
23.3 ± 0.5 | 22.1 | 25.5 | 1.04 ± 0.03 |
mise ls
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.2.9 ls |
20.5 ± 0.4 | 19.5 | 22.1 | 1.00 |
mise ls |
21.0 ± 0.6 | 19.8 | 23.2 | 1.02 ± 0.04 |
xtasks/test/perf
| Command | mise-2026.2.9 | mise | Variance |
|---|---|---|---|
| install (cached) | 122ms | 123ms | +0% |
| ls (cached) | 74ms | 75ms | -1% |
| bin-paths (cached) | 79ms | 79ms | +0% |
| task-ls (cached) | 547ms | -32% |
### 🚀 Features - **(activate)** add shims directory as fallback when auto-install is enabled by @ctaintor in [#8106](#8106) - **(env)** add `tools` variable to tera template context by @jdx in [#8108](#8108) - **(set)** add --stdin flag for multiline environment variables by @jdx in [#8110](#8110) ### 🐛 Bug Fixes - **(backend)** improve conda patchelf and dependency resolution for complex packages by @jdx in [#8087](#8087) - **(ci)** fix validate-new-tools grep pattern for test field by @jdx in [#8100](#8100) - **(config)** make MISE_OFFLINE work correctly by gracefully skipping network calls by @jdx in [#8109](#8109) - **(github)** skip v prefix for "latest" version by @jdx in [#8105](#8105) - **(gitlab)** resolve tool options from config for aliased tools by @jdx in [#8084](#8084) - **(install)** use version_expr for Flutter to fix version resolution by @jdx in [#8081](#8081) - **(registry)** add Linux support for tuist by @fortmarek in [#8102](#8102) - **(release)** write release notes to file instead of capturing stdout by @jdx in [#8086](#8086) - **(upgrade)** tools are not uninstalled properly due to outdated symlink by @roele in [#8099](#8099) - **(upgrade)** ensure uninstallation failure does not leave invalid symlinks by @roele in [#8101](#8101) - SLSA for in-toto statement with no signatures by @gerhard in [#8094](#8094) - Vfox Plugin Auto-Installation for Environment Directives by @pose in [#8035](#8035) ### 📚 Documentation - use mise activate for PowerShell in getting-started by @rileychh in [#8112](#8112) ### 📦 Registry - add conda backend for mysql by @jdx in [#8080](#8080) - add conda backends for 10 asdf-only tools by @jdx in [#8083](#8083) - added podman-tui by @tony-sol in [#8098](#8098) ### Chore - sort settings.toml alphabetically and add test by @jdx in [#8111](#8111) ### New Contributors - @ctaintor made their first contribution in [#8106](#8106) - @rileychh made their first contribution in [#8112](#8112) - @fortmarek made their first contribution in [#8102](#8102) - @pose made their first contribution in [#8035](#8035) - @gerhard made their first contribution in [#8094](#8094) ## 📦 Aqua Registry Updates #### New Packages (2) - [`entireio/cli`](https://github.com/entireio/cli) - [`rmitchellscott/reManager`](https://github.com/rmitchellscott/reManager) #### Updated Packages (1) - [`atuinsh/atuin`](https://github.com/atuinsh/atuin)
### 🚀 Features - **(activate)** add shims directory as fallback when auto-install is enabled by @ctaintor in [#8106](#8106) - **(env)** add `tools` variable to tera template context by @jdx in [#8108](#8108) - **(set)** add --stdin flag for multiline environment variables by @jdx in [#8110](#8110) ### 🐛 Bug Fixes - **(backend)** improve conda patchelf and dependency resolution for complex packages by @jdx in [#8087](#8087) - **(ci)** fix validate-new-tools grep pattern for test field by @jdx in [#8100](#8100) - **(config)** make MISE_OFFLINE work correctly by gracefully skipping network calls by @jdx in [#8109](#8109) - **(github)** skip v prefix for "latest" version by @jdx in [#8105](#8105) - **(gitlab)** resolve tool options from config for aliased tools by @jdx in [#8084](#8084) - **(install)** use version_expr for Flutter to fix version resolution by @jdx in [#8081](#8081) - **(registry)** add Linux support for tuist by @fortmarek in [#8102](#8102) - **(release)** write release notes to file instead of capturing stdout by @jdx in [#8086](#8086) - **(upgrade)** tools are not uninstalled properly due to outdated symlink by @roele in [#8099](#8099) - **(upgrade)** ensure uninstallation failure does not leave invalid symlinks by @roele in [#8101](#8101) - SLSA for in-toto statement with no signatures by @gerhard in [#8094](#8094) - Vfox Plugin Auto-Installation for Environment Directives by @pose in [#8035](#8035) ### 📚 Documentation - use mise activate for PowerShell in getting-started by @rileychh in [#8112](#8112) ### 📦 Registry - add conda backend for mysql by @jdx in [#8080](#8080) - add conda backends for 10 asdf-only tools by @jdx in [#8083](#8083) - added podman-tui by @tony-sol in [#8098](#8098) ### Chore - sort settings.toml alphabetically and add test by @jdx in [#8111](#8111) ### New Contributors - @ctaintor made their first contribution in [#8106](#8106) - @rileychh made their first contribution in [#8112](#8112) - @fortmarek made their first contribution in [#8102](#8102) - @pose made their first contribution in [#8035](#8035) - @gerhard made their first contribution in [#8094](#8094) ## 📦 Aqua Registry Updates #### New Packages (2) - [`entireio/cli`](https://github.com/entireio/cli) - [`rmitchellscott/reManager`](https://github.com/rmitchellscott/reManager) #### Updated Packages (1) - [`atuinsh/atuin`](https://github.com/atuinsh/atuin)
## Summary - Sorts all sections in `settings.toml` alphabetically - Adds a unit test (`test_settings_toml_is_sorted`) that asserts the keys remain in alphabetical order, so future additions stay organized ## Test plan - [x] `cargo test test_settings_toml_is_sorted` passes - [x] `cargo check` succeeds (build.rs still parses settings.toml correctly) - [x] `mise run lint-fix` passes clean 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Mostly a non-functional reordering of `settings.toml`, plus a new unit test that could be slightly brittle if TOML parsing/order semantics change. > > **Overview** > Reorders `settings.toml` sections to be alphabetically sorted, without changing the underlying setting definitions. > > Adds `test_settings_toml_is_sorted` in `src/config/settings.rs` that parses `settings.toml` and asserts top-level and nested setting keys remain in alphabetical order (skipping grouping-only tables), preventing future drift. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit aa1dfdb. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
### 🚀 Features - **(activate)** add shims directory as fallback when auto-install is enabled by @ctaintor in [jdx#8106](jdx#8106) - **(env)** add `tools` variable to tera template context by @jdx in [jdx#8108](jdx#8108) - **(set)** add --stdin flag for multiline environment variables by @jdx in [jdx#8110](jdx#8110) ### 🐛 Bug Fixes - **(backend)** improve conda patchelf and dependency resolution for complex packages by @jdx in [jdx#8087](jdx#8087) - **(ci)** fix validate-new-tools grep pattern for test field by @jdx in [jdx#8100](jdx#8100) - **(config)** make MISE_OFFLINE work correctly by gracefully skipping network calls by @jdx in [jdx#8109](jdx#8109) - **(github)** skip v prefix for "latest" version by @jdx in [jdx#8105](jdx#8105) - **(gitlab)** resolve tool options from config for aliased tools by @jdx in [jdx#8084](jdx#8084) - **(install)** use version_expr for Flutter to fix version resolution by @jdx in [jdx#8081](jdx#8081) - **(registry)** add Linux support for tuist by @fortmarek in [jdx#8102](jdx#8102) - **(release)** write release notes to file instead of capturing stdout by @jdx in [jdx#8086](jdx#8086) - **(upgrade)** tools are not uninstalled properly due to outdated symlink by @roele in [jdx#8099](jdx#8099) - **(upgrade)** ensure uninstallation failure does not leave invalid symlinks by @roele in [jdx#8101](jdx#8101) - SLSA for in-toto statement with no signatures by @gerhard in [jdx#8094](jdx#8094) - Vfox Plugin Auto-Installation for Environment Directives by @pose in [jdx#8035](jdx#8035) ### 📚 Documentation - use mise activate for PowerShell in getting-started by @rileychh in [jdx#8112](jdx#8112) ### 📦 Registry - add conda backend for mysql by @jdx in [jdx#8080](jdx#8080) - add conda backends for 10 asdf-only tools by @jdx in [jdx#8083](jdx#8083) - added podman-tui by @tony-sol in [jdx#8098](jdx#8098) ### Chore - sort settings.toml alphabetically and add test by @jdx in [jdx#8111](jdx#8111) ### New Contributors - @ctaintor made their first contribution in [jdx#8106](jdx#8106) - @rileychh made their first contribution in [jdx#8112](jdx#8112) - @fortmarek made their first contribution in [jdx#8102](jdx#8102) - @pose made their first contribution in [jdx#8035](jdx#8035) - @gerhard made their first contribution in [jdx#8094](jdx#8094) ## 📦 Aqua Registry Updates #### New Packages (2) - [`entireio/cli`](https://github.com/entireio/cli) - [`rmitchellscott/reManager`](https://github.com/rmitchellscott/reManager) #### Updated Packages (1) - [`atuinsh/atuin`](https://github.com/atuinsh/atuin)
### 🚀 Features - **(activate)** add shims directory as fallback when auto-install is enabled by @ctaintor in [jdx#8106](jdx#8106) - **(env)** add `tools` variable to tera template context by @jdx in [jdx#8108](jdx#8108) - **(set)** add --stdin flag for multiline environment variables by @jdx in [jdx#8110](jdx#8110) ### 🐛 Bug Fixes - **(backend)** improve conda patchelf and dependency resolution for complex packages by @jdx in [jdx#8087](jdx#8087) - **(ci)** fix validate-new-tools grep pattern for test field by @jdx in [jdx#8100](jdx#8100) - **(config)** make MISE_OFFLINE work correctly by gracefully skipping network calls by @jdx in [jdx#8109](jdx#8109) - **(github)** skip v prefix for "latest" version by @jdx in [jdx#8105](jdx#8105) - **(gitlab)** resolve tool options from config for aliased tools by @jdx in [jdx#8084](jdx#8084) - **(install)** use version_expr for Flutter to fix version resolution by @jdx in [jdx#8081](jdx#8081) - **(registry)** add Linux support for tuist by @fortmarek in [jdx#8102](jdx#8102) - **(release)** write release notes to file instead of capturing stdout by @jdx in [jdx#8086](jdx#8086) - **(upgrade)** tools are not uninstalled properly due to outdated symlink by @roele in [jdx#8099](jdx#8099) - **(upgrade)** ensure uninstallation failure does not leave invalid symlinks by @roele in [jdx#8101](jdx#8101) - SLSA for in-toto statement with no signatures by @gerhard in [jdx#8094](jdx#8094) - Vfox Plugin Auto-Installation for Environment Directives by @pose in [jdx#8035](jdx#8035) ### 📚 Documentation - use mise activate for PowerShell in getting-started by @rileychh in [jdx#8112](jdx#8112) ### 📦 Registry - add conda backend for mysql by @jdx in [jdx#8080](jdx#8080) - add conda backends for 10 asdf-only tools by @jdx in [jdx#8083](jdx#8083) - added podman-tui by @tony-sol in [jdx#8098](jdx#8098) ### Chore - sort settings.toml alphabetically and add test by @jdx in [jdx#8111](jdx#8111) ### New Contributors - @ctaintor made their first contribution in [jdx#8106](jdx#8106) - @rileychh made their first contribution in [jdx#8112](jdx#8112) - @fortmarek made their first contribution in [jdx#8102](jdx#8102) - @pose made their first contribution in [jdx#8035](jdx#8035) - @gerhard made their first contribution in [jdx#8094](jdx#8094) ## 📦 Aqua Registry Updates #### New Packages (2) - [`entireio/cli`](https://github.com/entireio/cli) - [`rmitchellscott/reManager`](https://github.com/rmitchellscott/reManager) #### Updated Packages (1) - [`atuinsh/atuin`](https://github.com/atuinsh/atuin)
Summary
settings.tomlalphabeticallytest_settings_toml_is_sorted) that asserts the keys remain in alphabetical order, so future additions stay organizedTest plan
cargo test test_settings_toml_is_sortedpassescargo checksucceeds (build.rs still parses settings.toml correctly)mise run lint-fixpasses clean🤖 Generated with Claude Code
Note
Low Risk
Mostly a non-functional reordering of
settings.toml, plus a new unit test that could be slightly brittle if TOML parsing/order semantics change.Overview
Reorders
settings.tomlsections to be alphabetically sorted, without changing the underlying setting definitions.Adds
test_settings_toml_is_sortedinsrc/config/settings.rsthat parsessettings.tomland asserts top-level and nested setting keys remain in alphabetical order (skipping grouping-only tables), preventing future drift.Written by Cursor Bugbot for commit aa1dfdb. This will update automatically on new commits. Configure here.