-
Notifications
You must be signed in to change notification settings - Fork 145
chore: update uuid format names #1251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: JP-Ellis <josh@jpellis.me>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR defines a reusable type for UUID format names to improve code maintainability and consistency across modules. The change replaces inline Literal type annotations with a centralized _UUID_FORMAT_NAMES type definition.
- Extracts UUID format names into a reusable
_UUID_FORMAT_NAMEStype - Updates type annotations to use the new centralized type
- Adds explicit type annotations to
_UUID_FORMATSdictionaries
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/pact/match/init.py | Defines _UUID_FORMAT_NAMES type and updates function parameter annotation |
| src/pact/generate/init.py | Defines _UUID_FORMAT_NAMES type and updates function parameter annotation |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
|
||
|
|
||
| _UUID_FORMATS = { | ||
| _UUID_FORMAT_NAMES = Literal["simple", "lowercase", "uppercase", "urn"] |
Copilot
AI
Sep 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The _UUID_FORMAT_NAMES type is duplicated across both files. Consider defining it in a shared module to maintain a single source of truth and prevent inconsistencies.
| _UUID_FORMAT_NAMES = Literal["simple", "lowercase", "uppercase", "urn"] | |
| from pact.types import _UUID_FORMAT_NAMES |
|
|
||
|
|
||
| _UUID_FORMATS = { | ||
| _UUID_FORMAT_NAMES = Literal["simple", "lowercase", "uppercase", "urn"] |
Copilot
AI
Sep 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The _UUID_FORMAT_NAMES type is duplicated across both files. Consider defining it in a shared module to maintain a single source of truth and prevent inconsistencies.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1251 +/- ##
====================================
Coverage 52% 52%
====================================
Files 32 32
Lines 3725 3727 +2
====================================
+ Hits 1963 1965 +2
Misses 1762 1762
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
📝 Summary
Define types for the various supported UUID formats.
🚨 Breaking Changes🔥 Motivation
🔨 Test Plan
🔗 Related issues/PRs