Skip to content

Add golangci-lint to codebase & CI#96

Merged
austin-denoble merged 8 commits into
mainfrom
adenoble/golangci-lint
Jun 10, 2026
Merged

Add golangci-lint to codebase & CI#96
austin-denoble merged 8 commits into
mainfrom
adenoble/golangci-lint

Conversation

@austin-denoble

@austin-denoble austin-denoble commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

Problem

Currently, this Go codebase doesn't support a .golangci-lint configuration, and there's no validation for lint violations in CI.

Solution

Adds .golangci.yml (v2, standard preset + bodyclose/gocritic/misspell/unconvert/unparam/nolintlint), a lint job in ci.yaml, and a just lint recipe. Fixes all 91 issues reported by the enabled linters across 36 files. errcheck (312) and revive (578) are disabled pending dedicated cleanup PRs.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • Infrastructure change (CI configs, etc)
  • Non-code change (docs, etc)
  • None of the above: (explain here)

Test Plan


Note

Low Risk
Mostly style and CI; login session cleanup and root cancel timing are small behavioral changes in auth/shutdown paths but align with clearer lifecycle handling.

Overview
Adds golangci-lint to the repo: new .golangci.yml (v2, standard preset plus bodyclose, gocritic, misspell, unconvert, unparam, nolintlint; errcheck and revive left off for follow-up PRs), a lint job in GitHub Actions, and a just lint recipe.

The rest of the diff is mechanical fixes so the enabled linters pass (~91 issues across ~36 files): octal file modes (0o755/0o600), switch instead of if/else chains, named return values on mocks, combined string params, lowercase fmt.Errorf strings, http.NoBody, bodyclose in tests, and small refactors (e.g. config list no longer returns an error from runListCmd).

Behavioral tweaks worth noting: OAuth session cleanup in pollForResult runs explicitly on each exit path instead of a single defer; root Execute calls cancel() after the command finishes rather than defer cancel() at entry.

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

Adds .golangci.yml (v2, standard preset + bodyclose/gocritic/misspell/unconvert/unparam/nolintlint), a lint job in ci.yaml, and a just lint recipe. Fixes all 91 issues reported by the enabled linters across 36 files. errcheck (312) and revive (578) are disabled pending dedicated cleanup PRs.
Bump action to v7, pin to v2.12.2, and move exclude-rules to linters.exclusions.rules per the v2 config schema.
…, so the error return was dead code. Drop it, simplify the caller, and clean up the now-unused imports.
…ves two gocritic suppressions: collapses the defer/os.Exit pattern in Execute() and eliminates defer-in-loop in pollForResult().
@austin-denoble austin-denoble merged commit e42a719 into main Jun 10, 2026
9 checks passed
@austin-denoble austin-denoble deleted the adenoble/golangci-lint branch June 10, 2026 17:27
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.

1 participant