-
-
Notifications
You must be signed in to change notification settings - Fork 150
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: Extract say to its own file #312
Conversation
I really like the idea, but I would have expected it to be its own package and export just few functions and not all. What do you think about this? |
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.
I think we should use a different package and have some functions private
You're just teaching me some go, and I love it! |
bfdbdd7
to
6d2b68b
Compare
I'm stuck. The tests finish with an exit code and I don't know why. |
Ok, I understand now. Trying to find a solution |
solved |
b2074af
to
c61db28
Compare
9f63182
to
8b344a2
Compare
"Error: ./mob.go:1150:3: undefined: sayFix" this is not the version I would have liked it to use. |
c572e98
to
c7c7a94
Compare
ok, we got this. |
@@ -664,55 +654,55 @@ func printDeprecatedDoneSquashMessage(value string) { | |||
|
|||
if unquotedValue == "true" || unquotedValue == "false" { | |||
newValue := doneSquash(unquotedValue) | |||
say("MOB_DONE_SQUASH is set to the deprecated value " + value + ". Use the value " + newValue + " instead.") | |||
say.Say("MOB_DONE_SQUASH is set to the deprecated value " + value + ". Use the value " + newValue + " instead.") |
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.
Shouldn't this be a Warning?
} | ||
} | ||
|
||
func removed(key string, message string) { | ||
if _, set := os.LookupEnv(key); set { | ||
say("Configuration option '" + key + "' is no longer used.") | ||
say(message) | ||
say.Say("Configuration option '" + key + "' is no longer used.") |
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.
This can also be a Warning
say("Configuration option '" + key + "' is no longer used.") | ||
say(message) | ||
say.Say("Configuration option '" + key + "' is no longer used.") | ||
say.Say(message) |
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.
same here
} | ||
} | ||
|
||
func deprecated(key string, message string) { | ||
if _, set := os.LookupEnv(key); set { | ||
say("Configuration option '" + key + "' is deprecated.") | ||
say(message) | ||
say.Say("Configuration option '" + key + "' is deprecated.") |
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.
same here
say("Configuration option '" + key + "' is deprecated.") | ||
say(message) | ||
say.Say("Configuration option '" + key + "' is deprecated.") | ||
say.Say(message) |
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.
same here
} | ||
} | ||
|
||
func experimental(key string) { | ||
if _, set := os.LookupEnv(key); set { | ||
say("Configuration option '" + key + "' is experimental. Be prepared that this option will be removed!") | ||
say.Say("Configuration option '" + key + "' is experimental. Be prepared that this option will be removed!") |
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.
same here
@@ -877,10 +867,10 @@ func (branch Branch) isOrphanWipBranch(configuration Configuration) bool { | |||
} | |||
|
|||
func branch(configuration Configuration) { | |||
say(silentgit("branch", "--list", "--remote", newBranch("*").addWipPrefix(configuration).remote(configuration).Name)) | |||
say.Say(silentgit("branch", "--list", "--remote", newBranch("*").addWipPrefix(configuration).remote(configuration).Name)) |
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.
does that make sense? why don't we use git
instead of say.Say(silentgit(...))
|
||
// DEPRECATED | ||
say(silentgit("branch", "--list", "--remote", newBranch("mob-session").remote(configuration).Name)) | ||
say.Say(silentgit("branch", "--list", "--remote", newBranch("mob-session").remote(configuration).Name)) |
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.
same here
I agree with all the points you made, however it is not a part of the change I'm trying to make in this pr. I just want to move say to its own package. We should improve how say is used, but that's another step. Let's make small steps and integrate often. |
I agree. That's why I approved the PR but leaved the comments. |
Ah, I didn't get that. So I'll merge it then. |
A first step tackling #296