Skip to content

Refactor: replace direct use of ExtendedEnumMeta with ExtendedEnum class #1051

New issue

Have a question about this project? Sign up for a free account to open an issue and contact its maintainers and the community.

By clicking “Sign up for ”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on ? Sign in to your account

Merged
merged 4 commits into from
Feb 4, 2025

Conversation

mrDzurb
Copy link
Member

@mrDzurb mrDzurb commented Feb 2, 2025

Summary

Previously, every enum-like class had metaclass=ExtendedEnumMeta applied directly. This PR introduces a unified ExtendedEnum base class (which itself uses ExtendedEnumMeta) and updates all references to inherit from ExtendedEnum instead.

Benefits

  • Reduces repetition by centralizing the metaclass logic in ExtendedEnum.
  • All enum-like classes now share the same structure and behaviors.
  • Future updates to the metaclass functionality only need to happen in one place, making it easier to maintain and extend.

Changes

  • Added a new ExtendedEnum base class with metaclass=ExtendedEnumMeta.
  • Updated all existing classes using metaclass=ExtendedEnumMeta to inherit from ExtendedEnum instead.
  • Removed direct references to metaclass=ExtendedEnumMeta on child classes.

If any additional specialized behavior is needed, it can be added in the ExtendedEnum class.

@oracle-contributor-agreementoracle-contributor-agreement bot added the OCA VerifiedAll contributors have signed the Oracle Contributor Agreement.label Feb 2, 2025
@github-actionsGitHub Actions
Copy link

-actions bot commented Feb 2, 2025

📌 Cov diff with main:

Coverage-18%

📌 Overall coverage:

Coverage-19.57%

@github-actionsGitHub Actions
Copy link

-actions bot commented Feb 2, 2025

📌 Cov diff with main:

Coverage-71%

📌 Overall coverage:

Coverage-56.72%

Copy link
Member

@VipulMascarenhas VipulMascarenhas left a comment

Choose a reason for hiding this comment

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

lgtm 👍

@github-actionsGitHub Actions
Copy link

-actions bot commented Feb 3, 2025

📌 Cov diff with main:

Coverage-71%

📌 Overall coverage:

Coverage-56.73%

@VipulMascarenhasVipulMascarenhas mentioned this pull request Feb 3, 2025
@github-actionsGitHub Actions
Copy link

-actions bot commented Feb 4, 2025

📌 Cov diff with main:

Coverage-71%

📌 Overall coverage:

Coverage-56.67%

@mrDzurbmrDzurb merged commit 1932376 into main Feb 4, 2025
21 of 22 checks passed
Sign up for free to join this conversation on . Already have an account? Sign in to comment
Labels
OCA VerifiedAll contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants