-
-
Notifications
You must be signed in to change notification settings - Fork 103
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
Mr show config comment #417
Conversation
Call the config setup code from the main Run function. This allows config variables to be used for all functions. Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Codecov Report
@@ Coverage Diff @@
## master #417 +/- ##
==========================================
+ Coverage 62.17% 62.30% +0.12%
==========================================
Files 50 50
Lines 3141 3146 +5
==========================================
+ Hits 1953 1960 +7
+ Misses 1034 1032 -2
Partials 154 154
Continue to review full report at Codecov.
|
I'd like to always display the full comments when viewing an MR or Issue. Add a "comments" config variable that sets the "--comments" flag on 'mr show' and 'issue show'. Add a "comments" local config option for the show commmands. Additional fix: Fix a leftover HCL to TOML change in the README Signed-off-by: Prarit Bhargava <prarit@redhat.com>
14a5073
to
4104b40
Compare
viper.SetConfigName("show_metadata") | ||
viper.SetConfigType("toml") | ||
// write data | ||
if _, ok := viper.ReadInConfig().(viper.ConfigFileNotFoundError); ok { |
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.
Might be good to abstract some of this config handling into the config package, perhaps some general purpose functionality for command specific config. It also seems a tad strange that the config overrides (like comments = true
) can only be set in the repo specific config?
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.
It's funny that you bring this up. When I was writing the code I was thinking the exact same thing: this code could all be centralized into the config code but wasn't 100% sure if you wanted it there. I'll definitely do that in another merge.
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.
Might be good to abstract some of this config handling into the config package, perhaps some general purpose functionality for command specific config. It also seems a tad strange that the config overrides (like
comments = true
) can only be set in the repo specific config?
I moved this code over into the config in #430. As for the config overrides :) I'm working on getting the overrides working. I'm pretty close and hopefully should have something in the next few days for your review.
config: Add WorkTree functions As suggested in #417 (comment), move this code into the config code.
Add a local "comments" config option that always sets "--comments" for the mr and issue show commands.