Skip to content

[code-improvement] deduplication: consolidate kernel config checks - #160

Merged
Pedro Henrique Penna (ppenna) merged 1 commit into
devfrom
code-improvement/deduplicate-kernel-config-checks-8d55ff736de670a6
Sep 21, 2026
Merged

Pedro Henrique Penna (ppenna) merged 1 commit into
devfrom
code-improvement/deduplicate-kernel-config-checks-8d55ff736de670a6

Conversation

@ppenna

Copy link
Copy Markdown
Contributor

Scope: deduplication

Three private kernel-configuration validators repeated the same file read, membership scan, and missing-setting error path. This change moves that shared logic into one private helper while retaining the existing capability-specific wrappers and exact diagnostics.

The candidate is grounded in the adjacent implementations in scripts/nvx_tools/build.py. Searches of open microsoft/nvx issues and pull requests found no active work for this concern, and the recent code-improvement history contains no matching proposal or maintainer rejection.

Patch

  • scripts/nvx_tools/build.py: consolidate repeated kernel-config membership validation.
  • 1 file; 23 additions and 31 deletions (54 total changed lines).

Validation

Passed:

python -m unittest scripts.test_nvx_tools.BuildTests.test_sandbox_kernel_config_requires_every_feature scripts.test_nvx_tools.BuildTests.test_shared_status_kernel_config_is_required -v
python -m compileall -q scripts
python -m ruff check scripts
python -m pyright --pythonplatform Linux
python -m pyright --pythonplatform Windows
python -m ruff format --check scripts
git diff --check

No dependency, public API/CLI/ABI, gitlink, or OpenVMM change was made.

Generated by code-improvement · copilot · gpt56 · 103.8 AIC · ⌖ 24.1 AIC · ⊞ 15.9K ·

  • expires on Oct 5, 2026, 5:51 AM UTC

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings September 21, 2026 05:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The focused refactor preserves behavior, diagnostics, and existing interfaces.

Review effort: Balanced
Findings: None

What changed in this PR

Consolidates duplicated kernel configuration validation while preserving existing wrappers and diagnostics.

Changes:

  • Adds a shared private validation helper.
  • Delegates three capability-specific validators to it.
File Description
scripts/​nvx_tools/​build.py Deduplicates kernel configuration checks.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@ppenna
Pedro Henrique Penna (ppenna) marked this pull request as ready for review September 21, 2026 13:05
@ppenna
Pedro Henrique Penna (ppenna) merged commit edd0be2 into dev Sep 21, 2026
40 checks passed
@ppenna
Pedro Henrique Penna (ppenna) deleted the code-improvement/deduplicate-kernel-config-checks-8d55ff736de670a6 branch September 21, 2026 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants