-
Notifications
You must be signed in to change notification settings - Fork 281
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
Enable golangci-lint for build monitor #6012
Conversation
Signed-off-by: Nino Kodabande <[email protected]>
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.
check-spelling found more than 10 potential problems in the proposed changes. Check the Files changed tab for more details.
26ea840
to
4cec300
Compare
a4cc9b1
to
7810309
Compare
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.
Consider rebasing and squashing all commits into one — there's quite a few experimental ones that we don't need in our history.
.github/workflows/.golangci.yaml
Outdated
nolintlint: | ||
allow-leading-space: true # don't require machine-readable nolint directives (i.e. with no leading space) | ||
allow-unused: false # report any unused nolint directives | ||
require-explanation: false # don't require an explanation for nolint directives |
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'd like us to turn this on (but not in this PR); same as the next line.
sparse-checkout: src/go/github-runner-monitor | ||
sparse-checkout: | | ||
src/go/github-runner-monitor | ||
.github |
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.
.github | |
.github/workflows # For .golangci.yaml |
.github/workflows/.golangci.yaml
Outdated
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.
Would this get picked up as an (invalid) workflow?
Consider putting this in a subdirectory instead, e.g. .github/workflows/data/.golangci.yaml
. (Workflows never pick up files in subdirectories.)
working-directory: src/go/github-runner-monitor | ||
only-new-issues: true | ||
only-new-issues: true |
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.
Nit: missing EOL at EOF.
@@ -30,6 +30,8 @@ import ( | |||
"golang.org/x/sys/unix" | |||
) | |||
|
|||
var timeout = 30 |
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.
var timeout = 30 | |
var timeout = 30 * time.Second |
That makes it clearer what unit this is in (and fixes the cast below).
Also, shouldn't this be a const
?
7810309
to
2a2c78f
Compare
9f666bc
to
9105ab3
Compare
Signed-off-by: Nino Kodabande <[email protected]>
9105ab3
to
a1c15f9
Compare
Adds a
.golangci.yaml
that will be shared across all golang repos undersrc/go
. Also, enables the configuration argument for theGitHub Runner: Build Monitor
.Related: #5919