Skip to content

Refactor: Replace enum_from_string() functions with Enum.from_string() functions#573

Merged
y0urself merged 13 commits intomainfrom
y0urself/from-string-at-enum
Oct 11, 2021
Merged

Refactor: Replace enum_from_string() functions with Enum.from_string() functions#573
y0urself merged 13 commits intomainfrom
y0urself/from-string-at-enum

Conversation

@y0urself
Copy link
Copy Markdown
Member

@y0urself y0urself commented Oct 9, 2021

What:

Removing all get_entity_type_from_string() methods and replace them by EntityType.from_string() classmethods

Why:

  • Easier to handle, more uniform
  • They will be included into Gmp.types through this step.

How:

  • using @classmethod in the Enum to add methods to Enums ...

Checklist:

…ach it to the AlertCondition as a from_string() function.
@y0urself y0urself force-pushed the y0urself/from-string-at-enum branch from 47d7462 to ee27041 Compare October 9, 2021 07:05
@codecov
Copy link
Copy Markdown

codecov Bot commented Oct 9, 2021

Codecov Report

Merging #573 (cc8908f) into main (d04aea4) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #573   +/-   ##
=======================================
  Coverage   98.82%   98.83%           
=======================================
  Files          54       54           
  Lines        3923     3947   +24     
  Branches      934      934           
=======================================
+ Hits         3877     3901   +24     
  Misses         34       34           
  Partials       12       12           
Impacted Files Coverage Δ
gvm/protocols/latest.py 100.00% <ø> (ø)
gvm/protocols/next.py 100.00% <ø> (ø)
gvm/protocols/gmpv208/entities/alerts.py 98.57% <100.00%> (+0.02%) ⬆️
gvm/protocols/gmpv208/entities/credentials.py 100.00% <100.00%> (ø)
gvm/protocols/gmpv208/entities/entities.py 100.00% <100.00%> (ø)
gvm/protocols/gmpv208/entities/filter.py 100.00% <100.00%> (ø)
gvm/protocols/gmpv208/entities/hosts.py 100.00% <100.00%> (ø)
gvm/protocols/gmpv208/entities/permissions.py 100.00% <100.00%> (ø)
gvm/protocols/gmpv208/entities/port_lists.py 100.00% <100.00%> (ø)
gvm/protocols/gmpv208/entities/report_formats.py 100.00% <100.00%> (ø)
... and 11 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d04aea4...cc8908f. Read the comment docs.

@y0urself y0urself force-pushed the y0urself/from-string-at-enum branch from cb1a424 to ad6eaef Compare October 9, 2021 10:10
@y0urself y0urself force-pushed the y0urself/from-string-at-enum branch from a13e0fd to 8a77b96 Compare October 10, 2021 07:18
@y0urself y0urself force-pushed the y0urself/from-string-at-enum branch from 8559125 to a4bd399 Compare October 10, 2021 09:23
@y0urself y0urself marked this pull request as ready for review October 10, 2021 09:31
@y0urself y0urself requested a review from a team October 10, 2021 09:31
@y0urself y0urself enabled auto-merge October 10, 2021 09:32
@y0urself y0urself merged commit b6dec3d into main Oct 11, 2021
@y0urself y0urself deleted the y0urself/from-string-at-enum branch October 11, 2021 08:05
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