Skip to content
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

Merged
merged 2 commits into from
Nov 30, 2023
Merged

Enable golangci-lint for build monitor #6012

merged 2 commits into from
Nov 30, 2023

Conversation

Nino-K
Copy link
Member

@Nino-K Nino-K commented Nov 21, 2023

Adds a .golangci.yaml that will be shared across all golang repos under src/go. Also, enables the configuration argument for the GitHub Runner: Build Monitor.

Related: #5919

@Nino-K Nino-K marked this pull request as draft November 21, 2023 17:48
Copy link

@github-advanced-security github-advanced-security bot left a 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.

@Nino-K Nino-K force-pushed the enable-golangci branch 8 times, most recently from a4cc9b1 to 7810309 Compare November 29, 2023 18:38
@Nino-K Nino-K requested a review from mook-as November 29, 2023 18:54
@Nino-K Nino-K marked this pull request as ready for review November 29, 2023 18:54
Copy link
Contributor

@mook-as mook-as left a 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.

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
Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.github
.github/workflows # For .golangci.yaml

Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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?

@mook-as mook-as merged commit 8dd06e9 into main Nov 30, 2023
17 checks passed
@mook-as mook-as deleted the enable-golangci branch November 30, 2023 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants