Skip to content

Enable errcheck and staticcheck for golangci-lint v2 and resolve all issues#4924

Open
amanfcp wants to merge 10 commits into
mainfrom
INS-443
Open

Enable errcheck and staticcheck for golangci-lint v2 and resolve all issues#4924
amanfcp wants to merge 10 commits into
mainfrom
INS-443

Conversation

@amanfcp
Copy link
Copy Markdown
Contributor

@amanfcp amanfcp commented Apr 27, 2026

Description:

  • Removes disable flag from lint.sh and lint.yml
  • Resolve all errcheck issues
  • Resolve all staticcheck issues

Checklist:

  • Tests passing (make test-community)?
  • Lint passing (make lint this requires golangci-lint)?

Note

Medium Risk
Touches a large number of analyzers/detectors with mostly mechanical error-handling and style changes, but includes a few small logic tweaks (e.g., Postgres DB privilege filtering and AWS session token heuristics) that could affect detection/analysis behavior.

Overview
Enables errcheck and staticcheck in CI by removing the workflow’s explicit disables, and then resolves the resulting findings across the repo.

Most changes are mechanical: consistently ignoring non-critical return values (e.g., Close(), RemoveAll(), Setenv()), switching to strings.ReplaceAll, and small refactors to switch statements / error message casing.

Includes a couple behavior changes worth review: fixes Postgres database name collection to use the correct connect privilege field, adjusts AWS session token validation logic, and updates HTML decoder tests to reflect DecodableChunk’s embedded Chunk (got.Data vs got.Chunk.Data).

Reviewed by Cursor Bugbot for commit 9c539b6. Bugbot is set up for automated code reviews on this repo. Configure here.

@amanfcp amanfcp requested a review from a team April 27, 2026 12:43
@amanfcp amanfcp requested review from a team as code owners April 27, 2026 12:43
}()

bodyString := string(bodyBytes)
if !(res.StatusCode == http.StatusOK) {
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.

lol, who does that?

Comment thread pkg/gitparse/gitparse.go
Copy link
Copy Markdown
Contributor

@mustansir14 mustansir14 left a comment

Choose a reason for hiding this comment

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

Reviewing 800 files was a bit too much.... but I love how this makes the codebase super tidy! Thanks

@amanfcp amanfcp added the review/product-eng Team integrations reviewed, awaiting product-eng review label May 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review/product-eng Team integrations reviewed, awaiting product-eng review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants