-
Notifications
You must be signed in to change notification settings - Fork 137
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
Refactor parameter parsing #356
Refactor parameter parsing #356
Conversation
8c98f49
to
3acbb84
Compare
18b9ecb
to
5837518
Compare
5837518
to
0d3f579
Compare
996b06c
to
55a16b0
Compare
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.
JFYI: the reason I push %q
for file names and paths is that sometimes they consist of special chars (e.g. spaces or linebreaks) and wrapping them into double quotes makes it obvious where the start and the end of the string is.
c18f855
to
6c1df6d
Compare
…ng target file which would occasionally lead to errors due to existing file handler - removed unnecessary os.Exit - added debug logging
Co-authored-by: George L. Yermulnik <yz@yz.kiev.ua>
Co-authored-by: George L. Yermulnik <yz@yz.kiev.ua>
- refactored functions to private where possible. - removed main_test as it was not really a useful test.
- added test for non existing file for terragrunt and .terraform-version file
- added test for non existent version in terraform
- deferred files closures
…s file would lead to showing the dropdown list which cannot be handled in an integration test, thus the test runs infinitely
This reverts commit 32dc75c.
397d386
to
a08c5ee
Compare
@MatrixCrawler I'm trying to figure out whether it's me or > fgrep log ~/.tfswitch.toml
log-level = "DEBUG"
> tfswitch --version
19:20:58.844 INFO Reading configuration from "/home/giermulnik/.tfswitch.toml"
Version: v1.1.0
> tfswitch --version -g DEBUG
19:21:06.483 INFO [toml.go:15,getParamsTOML] Reading configuration from "/home/giermulnik/.tfswitch.toml"
Version: v1.1.0 |
This is my attempt in reorganizing the parameter parsing.
i extracted the different configuration parsers in single files for better overview and testing capabilities.
Here are some things i explicitly tested:
What i did not do is adding any more parameters to the i,e, toml file.
But this should be more easily doable with the refactored code.