chore: format VPM scripts and tests - #6
Conversation
PenguinDOOM
commented
Aug 8, 2026
- Apply consistent import and line-wrapping style
- Modernize collections.abc imports
- Add missing trailing newlines
- Apply consistent import and line-wrapping style - Modernize collections.abc imports - Add missing trailing newlines Co-authored-by: Copilot <copilot@github.com>
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| Duplication | 0 |
AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.
TIP This summary will be updated as you push new changes.
There was a problem hiding this comment.
Pull request overview
Applies consistent formatting across the VPM GitHub Action scripts and their unit tests, focusing on import layout, line wrapping, and a small typing import modernization to improve readability and consistency.
Changes:
- Reformats imports and long lines in
.github/scripts/*and.github/tests/*. - Modernizes
Mappingimport usage invpm_common.py(collections.abc). - Normalizes multi-line
with (...)and dict literal formatting in tests.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| .github/tests/test_vpm_yanks.py | Reformats imports, literals, and multi-line assertions for consistency. |
| .github/tests/test_vpm_receiver.py | Reformats imports, long strings, and multi-context with blocks. |
| .github/scripts/vpm_policy.py | Wraps long UpdateError raises for consistent line length/style. |
| .github/scripts/vpm_payload.py | Wraps long API/error-handling lines for consistent formatting. |
| .github/scripts/vpm_listing.py | Wraps long error message formatting in write_listing. |
| .github/scripts/vpm_common.py | Switches Mapping import to collections.abc and wraps long error raises. |
| .github/scripts/vpm_archive.py | Reformats with statement and error raises; adjusts typing imports. |
| .github/scripts/update_vpm.py | Reorders imports to match the chosen style. |
| .github/scripts/sync_vpm_yanks.py | Reformats imports into a parenthesized multi-line block and normalizes whitespace. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
Pull Request Overview
The PR is currently not up to standards based on automated analysis. While it successfully addresses the intent of standardizing code style and modernizing imports, two quality issues persist.
A high-severity issue was identified in .github/scripts/vpm_archive.py regarding an unused import. Additionally, the validate_payload function in .github/scripts/vpm_payload.py has grown beyond maintainability thresholds and should be refactored to separate concerns. No gaps in acceptance criteria were found.
1 comment outside of the diff
.github/scripts/vpm_payload.py
line 30⚪ LOW RISK
Suggestion: This method is handling too many responsibilities (extraction, formatting validation, and URL normalization). Splitting this into focused helper functions would improve testability and readability.Try running the following prompt in your IDE agent:
Refactor the
validate_payloadfunction in.github/scripts/vpm_payload.pyto reduce its length. Split the logic into two parts: one to extract and trim required values from the source mapping, and another to perform the regex and URL-specific validation checks.
Test suggestions
- Found recommended test scenario: Verify that load_manifest continues to reject package.json files with missing or empty required text fields after reformatting
- Found recommended test scenario: Verify that load_yank_policy correctly identifies and rejects malformed JSON documents including BOM, trailing content, and non-standard constants
- Found recommended test scenario: Verify that UpdateError messages remain consistent and matchable by existing unit test regex patterns
- Found recommended test scenario: Verify that multi-patch context managers (using the parenthesized syntax) correctly execute and rollback in test cases
TIP Improve review quality by adding custom instructions
TIP How was this review? Give us feedback
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
- Replace BinaryIO with IO[bytes] in read_limited - Remove the unused BinaryIO import