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:
copilot-swe-agent[bot] 2026-03-24 11:25:30 +00:00 committed by GitHub
parent fb2162c027
commit 7c5268da2c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 20 additions and 20 deletions

View file

@ -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
}

View file

@ -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()
}

View file

@ -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"
}

View file

@ -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

View file

@ -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(),

View file

@ -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
}

View file

@ -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
}