Skip to content

ci: golangci-lint workflow and lint fixes#450

Open
steiler wants to merge 2 commits into
mainfrom
ci/golangci-lint-workflow
Open

ci: golangci-lint workflow and lint fixes#450
steiler wants to merge 2 commits into
mainfrom
ci/golangci-lint-workflow

Conversation

@steiler

@steiler steiler commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator

Refs #323

Summary

  • Add a Go Checks GitHub Actions workflow that runs golangci-lint on pull requests and pushes to main (checkout/setup-go v5, golangci-lint-action v8, linter v2.4).
  • Add .golangci.yml (config version 2) and exclude ygot-generated tests/sdcioygot/sdcio_schema.go from reported issues.
  • Fix default golangci findings repo-wide (errcheck, staticcheck, govet inline/reflect.Pointer, ineffassign, unused, import cleanup, small correctness fixes such as errors.Join accumulation in validation results).

Test plan

  • go test ./... -short
  • golangci-lint run ./...

Add Go Checks workflow and golangci-lint v2 config (exclude ygot-generated
schema). Resolve errcheck, staticcheck, govet, ineffassign, and unused issues
across CLI, datastore, server, pool, tree, and utils.

Co-authored-by: Cursor <cursoragent@cursor.com>
@steiler steiler requested a review from a team as a code owner June 5, 2026 14:02
@steiler steiler linked an issue Jun 5, 2026 that may be closed by this pull request
Comment thread pkg/datastore/target/noop/noop.go Outdated
Comment thread pkg/server/datastore.go Outdated
Remove `_ = logf.IntoContext(ctx, log)` lines flagged by @alexandernorth
in noop.go and server/datastore.go. In noop.Get the logger was also
unused, so remove that too. In server.CreateDataStore the log is still
used, so only the dead assignment is dropped.

Co-authored-by: Cursor <cursoragent@cursor.com>
@codecov

codecov Bot commented Jun 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 30.13699% with 51 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pkg/tree/api/leaf_variants.go 35.29% 11 Missing ⚠️
pkg/datastore/target/gnmi/stream.go 0.00% 5 Missing ⚠️
pkg/datastore/datastore_rpc.go 0.00% 4 Missing ⚠️
pkg/tree/types/validation_result.go 0.00% 4 Missing ⚠️
pkg/datastore/target/netconf/nc.go 0.00% 3 Missing ⚠️
pkg/utils/notification.go 0.00% 3 Missing ⚠️
pkg/datastore/deviations.go 0.00% 2 Missing ⚠️
pkg/datastore/types/transaction.go 0.00% 2 Missing ⚠️
pkg/server/server.go 0.00% 2 Missing ⚠️
pkg/datastore/target/gnmi/gnmi.go 0.00% 1 Missing ⚠️
... and 14 more

📢 Thoughts on this report? Let us know!

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@alexandernorth alexandernorth left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm

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.

Add Lint Action

2 participants