Skip to content

chore: format VPM scripts and tests - #6

Merged
PenguinMaintainer merged 3 commits into
masterfrom
format-VPM-scripts-and-tests
Aug 8, 2026
Merged

chore: format VPM scripts and tests#6
PenguinMaintainer merged 3 commits into
masterfrom
format-VPM-scripts-and-tests

Conversation

@PenguinDOOM

Copy link
Copy Markdown
Collaborator
  • 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>
@codacy-production

codacy-production Bot commented Aug 8, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.

Run reviewer

TIP This summary will be updated as you push new changes.

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.

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 Mapping import usage in vpm_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.

Comment thread .github/scripts/vpm_archive.py Outdated

@codacy-production codacy-production Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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_payload function in .github/scripts/vpm_payload.py to 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

Comment thread .github/scripts/vpm_archive.py Outdated
PenguinDOOM and others added 2 commits August 9, 2026 07:47
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
@PenguinMaintainer
PenguinMaintainer enabled auto-merge (squash) August 8, 2026 22:54
@PenguinMaintainer
PenguinMaintainer merged commit 2acfb6b into master Aug 8, 2026
2 checks passed
@PenguinMaintainer
PenguinMaintainer deleted the format-VPM-scripts-and-tests branch August 8, 2026 22:54
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.

3 participants