refactor: fix lint issues for medium/low-effort linters
Co-authored-by: babakks <36728931+babakks@users.noreply.github.com> Agent-Logs-Url: https://github.com/cli/cli/sessions/8cdc9ba4-cdfc-4e14-981c-70b52630b5e5
This commit is contained in:
parent
fb2162c027
commit
7c5268da2c
7 changed files with 20 additions and 20 deletions
|
|
@ -36,7 +36,7 @@ type Client struct {
|
|||
http *http.Client
|
||||
}
|
||||
|
||||
func (c *Client) HTTP() *http.Client {
|
||||
func (c Client) HTTP() *http.Client {
|
||||
return c.http
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ const (
|
|||
TypePullRequest string = "PullRequest"
|
||||
)
|
||||
|
||||
func (i Issue) IsPullRequest() bool {
|
||||
func (i *Issue) IsPullRequest() bool {
|
||||
return i.Typename == TypePullRequest
|
||||
}
|
||||
|
||||
|
|
@ -411,14 +411,14 @@ func IssueStatus(client *Client, repo ghrepo.Interface, options IssueStatusOptio
|
|||
return &payload, nil
|
||||
}
|
||||
|
||||
func (i Issue) Link() string {
|
||||
func (i *Issue) Link() string {
|
||||
return i.URL
|
||||
}
|
||||
|
||||
func (i Issue) Identifier() string {
|
||||
func (i *Issue) Identifier() string {
|
||||
return i.ID
|
||||
}
|
||||
|
||||
func (i Issue) CurrentUserComments() []Comment {
|
||||
func (i *Issue) CurrentUserComments() []Comment {
|
||||
return i.Comments.CurrentUserComments()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -299,26 +299,26 @@ type PullRequestFile struct {
|
|||
ChangeType string `json:"changeType"`
|
||||
}
|
||||
|
||||
func (pr PullRequest) HeadLabel() string {
|
||||
func (pr *PullRequest) HeadLabel() string {
|
||||
if pr.IsCrossRepository {
|
||||
return fmt.Sprintf("%s:%s", pr.HeadRepositoryOwner.Login, pr.HeadRefName)
|
||||
}
|
||||
return pr.HeadRefName
|
||||
}
|
||||
|
||||
func (pr PullRequest) Link() string {
|
||||
func (pr *PullRequest) Link() string {
|
||||
return pr.URL
|
||||
}
|
||||
|
||||
func (pr PullRequest) Identifier() string {
|
||||
func (pr *PullRequest) Identifier() string {
|
||||
return pr.ID
|
||||
}
|
||||
|
||||
func (pr PullRequest) CurrentUserComments() []Comment {
|
||||
func (pr *PullRequest) CurrentUserComments() []Comment {
|
||||
return pr.Comments.CurrentUserComments()
|
||||
}
|
||||
|
||||
func (pr PullRequest) IsOpen() bool {
|
||||
func (pr *PullRequest) IsOpen() bool {
|
||||
return pr.State == "OPEN"
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -248,22 +248,22 @@ type GitIgnore struct {
|
|||
}
|
||||
|
||||
// RepoOwner is the login name of the owner
|
||||
func (r Repository) RepoOwner() string {
|
||||
func (r *Repository) RepoOwner() string {
|
||||
return r.Owner.Login
|
||||
}
|
||||
|
||||
// RepoName is the name of the repository
|
||||
func (r Repository) RepoName() string {
|
||||
func (r *Repository) RepoName() string {
|
||||
return r.Name
|
||||
}
|
||||
|
||||
// RepoHost is the GitHub hostname of the repository
|
||||
func (r Repository) RepoHost() string {
|
||||
func (r *Repository) RepoHost() string {
|
||||
return r.hostname
|
||||
}
|
||||
|
||||
// ViewerCanPush is true when the requesting user has push access
|
||||
func (r Repository) ViewerCanPush() bool {
|
||||
func (r *Repository) ViewerCanPush() bool {
|
||||
switch r.ViewerPermission {
|
||||
case "ADMIN", "MAINTAIN", "WRITE":
|
||||
return true
|
||||
|
|
@ -273,7 +273,7 @@ func (r Repository) ViewerCanPush() bool {
|
|||
}
|
||||
|
||||
// ViewerCanTriage is true when the requesting user can triage issues and pull requests
|
||||
func (r Repository) ViewerCanTriage() bool {
|
||||
func (r *Repository) ViewerCanTriage() bool {
|
||||
switch r.ViewerPermission {
|
||||
case "ADMIN", "MAINTAIN", "WRITE", "TRIAGE":
|
||||
return true
|
||||
|
|
|
|||
|
|
@ -225,7 +225,7 @@ func (e Editable) MilestoneId() (*string, error) {
|
|||
|
||||
// Clone creates a mostly-shallow copy of Editable suitable for use in parallel
|
||||
// go routines. Fields that would be mutated will be copied.
|
||||
func (e *Editable) Clone() Editable {
|
||||
func (e Editable) Clone() Editable {
|
||||
return Editable{
|
||||
Title: e.Title.clone(),
|
||||
Body: e.Body.clone(),
|
||||
|
|
|
|||
|
|
@ -149,12 +149,12 @@ type RepoMetadataFetcher interface {
|
|||
RepoMetadataFetch(api.RepoMetadataInput) (*api.RepoMetadataResult, error)
|
||||
}
|
||||
|
||||
func MetadataSurvey(p Prompt, io *iostreams.IOStreams, baseRepo ghrepo.Interface, fetcher RepoMetadataFetcher, state *IssueMetadataState, projectsV1Support gh.ProjectsV1Support, reviewerSearchFunc func(string) prompter.MultiSelectSearchResult) error {
|
||||
func MetadataSurvey(p Prompt, io *iostreams.IOStreams, baseRepo ghrepo.Interface, fetcher RepoMetadataFetcher, state *IssueMetadataState, projectsV1Support gh.ProjectsV1Support, reviewerSearchFunc func(string) prompter.MultiSelectSearchResult) error { //nolint:gocyclo
|
||||
isChosen := func(m string) bool {
|
||||
for _, c := range state.Metadata {
|
||||
if m == c {
|
||||
return true
|
||||
} //nolint:gocyclo
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@ type Commit struct {
|
|||
}
|
||||
|
||||
// Title is the display title for a run, falling back to the commit subject if unavailable
|
||||
func (r Run) Title() string {
|
||||
func (r *Run) Title() string {
|
||||
if r.DisplayTitle != "" {
|
||||
return r.DisplayTitle
|
||||
}
|
||||
|
|
@ -155,7 +155,7 @@ func (r Run) Title() string {
|
|||
|
||||
// WorkflowName returns the human-readable name of the workflow that this run belongs to.
|
||||
// TODO: consider lazy-loading the underlying API data to avoid extra API calls unless necessary
|
||||
func (r Run) WorkflowName() string {
|
||||
func (r *Run) WorkflowName() string {
|
||||
return r.workflowName
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue