-
Notifications
You must be signed in to change notification settings - Fork 10
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
handle PR files pages #60
base: main
Are you sure you want to change the base?
Conversation
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.
Thanks for the pr @teowa
instead of complicating this file with the logic of getting files from gh, could we follow the pattern here: https://github.com/katbyte/tctest/blob/main/lib/gh/pr.go ?
and create ListAllPullRequestFiles
/ GetAllPullRequestFiles
functions which should simplify this code?
as well as fix CI
thanks
@teowa - CI is still failing |
Seems the golangci-lint (version 1.47.3) panic while running CI, should we upgrade to the latest version? |
@teowa - if thats what it takes to fix it yes. thanks |
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.
Some fix for golangci-lint run -v
cli/gh-pr.go
Outdated
@@ -218,7 +218,6 @@ func (gr githubRepo) GetAllPullRequestFiles(pri int, filterRegExStr string) (*ma | |||
|
|||
return nil | |||
}) | |||
|
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.
cli/gh-pr.go:221: File is not gofumpt
-ed (gofumpt)
gh.Repo | ||
} | ||
|
||
func (f FlagData) NewRepo() githubRepo { | ||
func (f FlagData) NewRepo() GithubRepo { |
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.
cli/gh.go:15:29: unexported-return: exported method NewRepo returns unexported type cli.githubRepo, which can be annoying to use (revive)
func (f FlagData) NewRepo() githubRepo {
^
@@ -47,8 +47,8 @@ func (t *transport) RoundTrip(req *http.Request) (*http.Response, error) { | |||
return resp, nil | |||
} | |||
|
|||
func NewTransport(name string, t http.RoundTripper) *transport { | |||
return &transport{name, t} | |||
func NewTransport(name string, t http.RoundTripper) *Transport { |
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.
lib/chttp/http.go:50:53: unexported-return: exported func NewTransport returns unexported type *chttp.transport, which can be annoying to use (revive)
func NewTransport(name string, t http.RoundTripper) *transport {
^
tc.Server | ||
} | ||
|
||
func (f FlagData) NewServer() tcServer { |
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.
cli/tc.go:12:31: unexported-return: exported method NewServer returns unexported type cli.tcServer, which can be annoying to use (revive)
func (f FlagData) NewServer() tcServer {
^
} else { | ||
//revive:disable:indent-error-flow | ||
c.Printf(" milestone: <red>%s</> <gray>(%s)</>\n", filterMilestone, milestone) | ||
return false, nil | ||
} |
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.
cli/gh-pr-filters.go:99:11: indent-error-flow: if block ends with a return statement, so drop this else and outdent its block (revive)
} else {
c.Printf(" milestone: <red>%s</> <gray>(%s)</>\n", filterMilestone, milestone)
return false, nil
}
@@ -58,7 +58,7 @@ func prettyPrintJSON(b []byte) string { | |||
for i, p := range parts { | |||
if b := []byte(p); json.Valid(b) { | |||
var out bytes.Buffer | |||
// nolint:errcheck | |||
//nolint:errcheck |
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.
lib/chttp/http.go:61:4: directive // nolint:errcheck
should be written without leading space as //nolint:errcheck
(nolintlint)
// nolint:errcheck
^
@@ -89,14 +89,15 @@ func GetFilterForMilestone(milestoneRaw string) *Filter { | |||
PR: func(pr github.PullRequest) (bool, error) { | |||
milestone := pr.GetMilestone().GetTitle() | |||
|
|||
// nolint:gocritic | |||
//nolint:gocritic |
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.
cli/gh-pr-filters.go:92:4: directive // nolint:gocritic
should be written without leading space as //nolint:gocritic
(nolintlint)
// nolint:gocritic
^
@@ -207,7 +208,7 @@ func GetFilterForLabels(labels []string, and bool) *Filter { | |||
for filterLabel, negate := range filterLabelMap { | |||
_, found := labelMap[filterLabel] | |||
|
|||
// nolint:gocritic | |||
//nolint:gocritic |
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.
cli/gh-pr-filters.go:210:5: directive // nolint:gocritic
should be written without leading space as //nolint:gocritic
(nolintlint)
// nolint:gocritic
^
@@ -94,7 +94,7 @@ func (gr githubRepo) PrTests(pri int, filterRegExStr, splitTestsAt string) (*map | |||
} | |||
|
|||
// todo thread ctx | |||
// nolint: noctx | |||
//nolint: noctx |
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.
cli/gh-pr.go:97:3: directive // nolint: noctx
should be written without leading space as //nolint: noctx
(nolintlint)
// nolint: noctx
^
@@ -15,7 +15,6 @@ linters: | |||
- bidichk | |||
- containedctx | |||
- contextcheck | |||
- deadcode |
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.
WARN [runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused.
WARN [runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused.
WARN [runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner.
WARN [runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused.
from https://docs.github.com/en/rest/pulls/pulls?apiVersion=2022-11-28#list-pull-requests-files the PullRequests.listFiles by default returns 30 files, add a for loop to handle more files in PR.