fix(config): Improve INI validation warning messages#52
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR improves user-facing configuration diagnostics and consistency by making case-insensitive comparisons ASCII-stable (non-locale-dependent), deduplicating INI warning logic, and centralizing the "None" sentinel name.
Changes:
- Add
HoldFast::AsciiToLowerand update case-insensitive comparisons to avoid locale-dependentstd::tolower. - Refactor
LoadSettingswarning path to deduplicate “unrecognised action” warnings and makeReadHoldDurationwarnings more consolidated/actionable. - Introduce
HoldFast::kNoneNameand replace"None"comparison literals across config/UI/navigation call sites.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Utils.h | Adds AsciiToLower and updates CaseInsensitiveEqual to use ASCII-stable lowercasing. |
| src/Config.cpp | Consolidates fHoldDuration range warnings and deduplicates unrecognised-action warnings via a helper lambda. |
| src/LongPressAction.h | Adds HoldFast::kNoneName constant for the "None" sentinel. |
| src/MCMNavigator.cpp | Updates case-insensitive sort to use AsciiToLower and replaces "None" comparisons with kNoneName. |
| src/InputHandler.cpp | Replaces "None" comparison with kNoneName for pending MCM navigation. |
| src/MenuUI.cpp | Uses kNoneName for "None" comparisons in MCM target UI selection. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
4f9d83b to
1150942
Compare
1150942 to
2c00e35
Compare
…nrecognised helper; add kNoneName
2c00e35 to
87d1fa1
Compare
This was referenced Jun 17, 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.
Summary
AsciiToLowerhelper and updatesCaseInsensitiveEqual/CaseInsensitiveLessto use it instead of locale-dependentstd::tolower[CFG-5]warnIfUnrecognisedlambda to deduplicate the two unrecognised-action warning blocks inLoadSettings[STYLE-1, STYLE-2]ReadHoldDurationto a single consolidated range warning instead of four per-case messages [CFG-6]HoldFast::kNoneNameconstant and replaces all"None"comparison literals acrossConfig.cpp,MCMNavigator.cpp,InputHandler.cpp, andMenuUI.cpp[STYLE-3]The warning messages in
ReadHoldDurationand the unrecognised-action path are user-visible improvements — log output is now more actionable when the INI is misconfigured. Part of the June 2026 audit fix series (#51).Test plan
./scripts/build.sh)