-
Notifications
You must be signed in to change notification settings - Fork 19
Added go linting #493
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
Added go linting #493
Conversation
📝 WalkthroughWalkthroughAdds new CI workflows (autofix, CodeQL, pre-commit) and tooling configs (golangci-lint, pre-commit, Aqua, Codecov). Performs minor formatting in issue/PR templates and docs. Bumps actions/checkout to v5 in select workflows. Makes small Go source edits (variable declarations, build tag). Adds checksums and registry configs for Aqua. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Important Cloud Posse Engineering Team Review RequiredThis pull request modifies files that require Cloud Posse's review. Please be patient, and a core maintainer will review your changes. To expedite this process, reach out to us on Slack in the |
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@v4...v5) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]>
1ebd57f
to
47cc0b7
Compare
This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation. |
Removed PR Semver Labels and PR Size Labeler workflows from CodeQL configuration.
This configuration file sets up GolangCI-Lint with various linters and rules to enforce coding standards and best practices.
@coderabbitai review |
✅ Actions performedReview triggered.
|
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.
Actionable comments posted: 2
🧹 Nitpick comments (2)
.github/workflows/autofix.yml (1)
14-16
: Consider upgrading to checkout v5 for consistency.This workflow uses
actions/[email protected]
, while other workflows in this PR (test.yml, validate-codeowners.yml) have been upgraded toactions/checkout@v5
. Consider updating this for consistency across all workflows.Apply this diff to align with other workflows:
- - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v5.2.2 with: persist-credentials: falseNote: Update the commit hash to match the v5.2.2 release if upgrading.
.github/workflows/pre-commit.yml (1)
35-43
: Pin the Go tool versions for reproducible CI.Installing gofumpt at
@latest
(and golangci-lint without matching the lint job) makes every run depend on the momentary state of upstream releases, which is brittle. Please pin the versions here to the same ones declared via Aqua/golangci to keep CI reproducible.- go install mvdan.cc/gofumpt@latest + go install mvdan.cc/[email protected] @@ - go install github.com/golangci/golangci-lint/v2/cmd/[email protected] + go install github.com/golangci/golangci-lint/v2/cmd/[email protected]
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (26)
.github/ISSUE_TEMPLATE/bug_report.md
(2 hunks).github/ISSUE_TEMPLATE/bug_report.yml
(1 hunks).github/ISSUE_TEMPLATE/config.yml
(1 hunks).github/ISSUE_TEMPLATE/feature_request.md
(1 hunks).github/ISSUE_TEMPLATE/feature_request.yml
(2 hunks).github/PULL_REQUEST_TEMPLATE.md
(1 hunks).github/workflows/autofix.yml
(1 hunks).github/workflows/codeql.yml
(1 hunks).github/workflows/pre-commit.yml
(1 hunks).github/workflows/test.yml
(2 hunks).github/workflows/validate-codeowners.yml
(1 hunks).golangci.yml
(1 hunks).pre-commit-config.yaml
(1 hunks).vscode/launch.json
(1 hunks)aqua/aqua-checksums.json
(1 hunks)aqua/aqua.yaml
(1 hunks)aqua/imports/gofumpt.yaml
(1 hunks)codecov.yml
(1 hunks)docs/index.md
(1 hunks)examples/README.md
(1 hunks)examples/tests/components/terraform/test/test-component/providers_override.tf.json
(1 hunks)examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-schema-7.yaml
(0 hunks)internal/provider/data_source_deep_merge_json.go
(1 hunks)main.go
(1 hunks)templates/index.md.tmpl
(1 hunks)tools/tools.go
(1 hunks)
💤 Files with no reviewable changes (1)
- examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-schema-7.yaml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Summary
🔇 Additional comments (13)
tools/tools.go (1)
1-2
: Go build tag addition looks goodThe modern
//go:build tools
constraint alongside the legacy tag keeps the helper file consistent across Go versions. Nice and tidy.templates/index.md.tmpl (1)
16-16
: Consistent schema placeholder formatting retained.
The preservedtrimspace
usage keeps tfplugindocs output stable—nothing else to flag.docs/index.md (1)
21-21
: Schema section heading restored.
Bringing back the heading keeps the docs aligned with tfplugindocs output—looks good..github/workflows/test.yml (1)
29-29
: LGTM!The upgrade to
actions/checkout@v5
is appropriate and aligns with the PR's broader CI modernization efforts.Also applies to: 69-69
examples/README.md (1)
5-6
: LGTM!The text reflow improves readability without changing the semantic content.
internal/provider/data_source_deep_merge_json.go (1)
64-64
: LGTM!The change to use short variable declaration (
:=
) is more idiomatic for function-scoped variables in Go and likely aligns with the newly added linter rules..github/workflows/validate-codeowners.yml (1)
12-12
: LGTM!The upgrade to
actions/checkout@v5
is consistent with other workflow updates in this PR.main.go (1)
12-12
: LGTM!The simplified single-line variable declaration is cleaner and likely aligns with the newly added linter rules.
.github/workflows/autofix.yml (4)
21-22
: LGTM!The
aqua upc -prune
command correctly updates and prunes the checksum file, ensuring only necessary checksums are maintained.
31-43
: LGTM!The conditional execution of
gofumpt
based on changed Go files is efficient. The shellcheck disable for SC2086 is justified, as word splitting is intentional for passing multiple files to gofumpt.
50-54
: LGTM!The use of
|| true
for pre-commit hooks is appropriate in an autofix workflow, as the hooks may report issues while still fixing them. The autofix-ci/action will commit any changes made.
1-5
: LGTM!The comment clearly documents the strict naming requirement for Autofix CI, which is critical for developers to understand.
codecov.yml (1)
1-35
: LGTM!The Codecov configuration is well-structured with appropriate defaults:
- Project and patch coverage targets are reasonable for a Go project.
- The 1% threshold accounts for Codecov's rounding behavior.
- Marking patch coverage as
informational: true
(line 17) is appropriate for initial rollout, preventing it from blocking PRs while teams adjust to coverage expectations.- The ignore patterns correctly exclude mocks and test helpers from coverage calculations.
what
why
References