-
Notifications
You must be signed in to change notification settings - Fork 24
refactor: enable linter rule ST1016 for 'consistent method receiver names' #86
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -98,13 +98,13 @@ func (m *IOStreamsMock) IsTTY() bool { | |
| } | ||
|
|
||
| // SetExitCode sets the desired exit code in a thread-safe way | ||
| func (io *IOStreamsMock) SetExitCode(code ExitCode) { | ||
| atomic.StoreInt32((*int32)(&io.exitCode), int32(code)) | ||
| func (m *IOStreamsMock) SetExitCode(code ExitCode) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧪 Nice! I like
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yea, |
||
| atomic.StoreInt32((*int32)(&m.exitCode), int32(code)) | ||
| } | ||
|
|
||
| // GetExitCode returns the most-recently set desired exit code in a thread safe way | ||
| func (io *IOStreamsMock) GetExitCode() ExitCode { | ||
| return ExitCode(atomic.LoadInt32((*int32)(&io.exitCode))) | ||
| func (m *IOStreamsMock) GetExitCode() ExitCode { | ||
| return ExitCode(atomic.LoadInt32((*int32)(&m.exitCode))) | ||
| } | ||
|
|
||
| // InitLogFile mocks starting the debug info to | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -129,20 +129,20 @@ func (apps *TeamApps) IsEmpty() bool { | |
| // Basically, treat as a convenience getter intended for use in the context where | ||
| // you have a team you want to filter against and you don't care whether it's an | ||
| // auth or an app that corresponds. E.g. when you are comparing to --team flags | ||
| func (t *TeamApps) authOrAppTeamDomain() string { | ||
| if t.Auth.TeamDomain != "" && (t.Auth.TeamID == t.Hosted.App.TeamID || t.Auth.TeamID == t.Local.App.TeamID) { | ||
| func (apps *TeamApps) authOrAppTeamDomain() string { | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. note: The
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In implementations having a more complete variable name seems better to me. Thanks for linking these docs though. It makes for interesting considerations... 🎁
Sometimes I find it a hassle to search for single letter variables FWIW but this is the most interesting consideration. Perhaps I am needing to read more
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Edit: Wow I find the change that follows this in
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yea, I'm with you. Sometimes the single letter just doesn't feel right. For |
||
| if apps.Auth.TeamDomain != "" && (apps.Auth.TeamID == apps.Hosted.App.TeamID || apps.Auth.TeamID == apps.Local.App.TeamID) { | ||
| // Auth whose team id matches either hosted or local app's team | ||
| // Can be safely returned | ||
| return t.Auth.TeamDomain | ||
| return apps.Auth.TeamDomain | ||
| } | ||
|
|
||
| // If we get here we might be missing an auth OR the auth doesn't | ||
| // match any included app team ids (that is the case when the auth is org | ||
| // resolved for a workspace app) | ||
| if t.Hosted.App.TeamID != "" { | ||
| return t.Hosted.App.TeamDomain | ||
| if apps.Hosted.App.TeamID != "" { | ||
| return apps.Hosted.App.TeamDomain | ||
| } | ||
| return t.Local.App.TeamDomain | ||
| return apps.Local.App.TeamDomain | ||
| } | ||
|
|
||
| // authOrAppTeamID greedily returns a team ID corresponding to the TeamApps | ||
|
|
@@ -157,14 +157,14 @@ func (t *TeamApps) authOrAppTeamDomain() string { | |
| // Basically, treat as a convenience getter intended for use in the context where | ||
| // you have a team you want to filter against and you don't care whether it's an | ||
| // auth or an app that corresponds. E.g. when you are comparing to --team flags | ||
| func (t *TeamApps) authOrAppTeamID() string { | ||
| if t.Auth.TeamID != "" && (t.Hosted.App.TeamID == t.Auth.TeamID || t.Local.App.TeamID == t.Auth.TeamID) { | ||
| return t.Auth.TeamID | ||
| func (apps *TeamApps) authOrAppTeamID() string { | ||
| if apps.Auth.TeamID != "" && (apps.Hosted.App.TeamID == apps.Auth.TeamID || apps.Local.App.TeamID == apps.Auth.TeamID) { | ||
| return apps.Auth.TeamID | ||
| } | ||
| if t.Hosted.App.TeamID != "" { | ||
| return t.Hosted.App.TeamID | ||
| if apps.Hosted.App.TeamID != "" { | ||
| return apps.Hosted.App.TeamID | ||
| } | ||
| return t.Local.App.TeamID | ||
| return apps.Local.App.TeamID | ||
| } | ||
|
|
||
| // appTransferDisclaimer contains a notice of lost app management permissions | ||
|
|
||
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.
🪓 ✨