Skip to content
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

Introduce a base enum class #1125

Merged
merged 2 commits into from
Feb 27, 2024
Merged

Introduce a base enum class #1125

merged 2 commits into from
Feb 27, 2024

Conversation

bjoernricks
Copy link
Contributor

What

Implement a base enum class for our type classes in python-gvm

Why

The current implementation before this PR contains from_string methods for every type. Introducing a base enum class avoids code duplication by using a generalized from_string method.

Checklist

  • Tests

This will simplify all our enums and reduce duplicate code.
Some enums like ScannerType and AliveTest are special and don't need to
be derived from our base enum class. Using our base enum class for all
other enums allows to remove all from_string methods and therefore
avoids code duplication.
@bjoernricks bjoernricks requested review from a team as code owners February 26, 2024 13:39
@bjoernricks bjoernricks enabled auto-merge (rebase) February 26, 2024 13:39
Copy link

Conventional Commits Report

Type Number
Changed 1
Added 1

🚀 Conventional commits found.

Copy link
Member

@y0urself y0urself left a comment

Choose a reason for hiding this comment

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

yes.

@bjoernricks bjoernricks merged commit 8236645 into main Feb 27, 2024
15 of 16 checks passed
@bjoernricks bjoernricks deleted the base-enum branch February 27, 2024 07:42
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