Add module settings parser coverage - #96
Merged
kissetfall merged 1 commit intoJul 17, 2026
Merged
Conversation
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.
EN
Problem
The module-settings audit still lacked direct parser boundary coverage and a test for duplicate QSID read widths. Current
mainalready covers verified writeback success and failure paths, while open PRs #91 and #94 add controller grouping and split-touchpad JSON fixtures. Duplicating those tests here would make this branch overlap unnecessarily.The parser also converted JSON QSID values with an unchecked
as u16cast, so values above 65535 could wrap into a supported setting ID.Fix
u16instead of allowing integer wraparound.main.Verification
cargo test: 195 passed.cargo test module_setting: 11 passed.cargo clippy --all-targets: passed with existing repository warnings.python3 scripts/check_i18n.py: passed.rustfmt --checkandgit diff --check: passed. Repository-widecargo fmt --all -- --checkremains blocked by pre-existing formatting differences insrc/keycode.rs.TARGET=aarch64-apple-darwin scripts/build_macos_app.sh: arm64 app, DMG, and ZIP built; architecture and code-signature validation passed.RU
Проблема
В аудите настроек модулей оставались непокрытыми граничные случаи парсера и выбор ширины чтения для повторяющихся QSID. Текущая ветка
mainуже содержит тесты успешной и ошибочной проверенной записи, а открытые PR #91 и #94 добавляют JSON-фикстуры для группировки контроллеров и разделенных touchpad-настроек. Дублирование этих тестов создало бы лишнее пересечение между ветками.Кроме того, парсер преобразовывал QSID из JSON через непроверенный
as u16, поэтому значения больше 65535 могли переполниться и превратиться в поддерживаемый идентификатор настройки.Исправление
u16, теперь отклоняются без целочисленного переполнения.main.Проверка
cargo test: прошли 195 тестов.cargo test module_setting: прошли 11 тестов.cargo clippy --all-targets: прошел с существующими предупреждениями репозитория.python3 scripts/check_i18n.py: прошел.rustfmt --checkиgit diff --check: прошли. Общийcargo fmt --all -- --checkпо-прежнему блокируется существующими отличиями форматирования вsrc/keycode.rs.TARGET=aarch64-apple-darwin scripts/build_macos_app.sh: собраны arm64-приложение, DMG и ZIP; архитектура и подпись прошли проверку.