-
Notifications
You must be signed in to change notification settings - Fork 19
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
make TerraformState classmethods more clear #20
Conversation
b2969f2
to
2e8e1f7
Compare
Codecov Report
@@ Coverage Diff @@
## master #20 +/- ##
==========================================
+ Coverage 92.27% 92.51% +0.23%
==========================================
Files 8 8
Lines 440 454 +14
==========================================
+ Hits 406 420 +14
Misses 34 34
Continue to review full report at Codecov.
|
2e8e1f7
to
6c90796
Compare
|
|
92688c3
to
5e4e619
Compare
1c78ff2
to
0395b0c
Compare
Update TerraformState and TerraformStateJson with annotations and docstrings |
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.
thanks, lgtm
This PR came about because in a previous update I abused the
load
classmethod as a way to updateTerraformState
after themodify_state
hook runs. Since it's a classmethod it spawns a new class object instead of loading over it's existing state. This introducesTerraformState.from_file
andTerraformState.from_state
classmethods which expand on what theload
classmethod was doing previously.load
now updates the existing invocation and the state parsing code has been moved to a static method.The two reservations I have and am looking to get explicit feedback on is:
load
be renamed toupdate
in order to better highlight it's purpse?from_state
be renamed to something likefrom_str
given the data passed to it is likely a string representation of state?