Skip to content

Add ci and lint move to camelCase JSON#7

Merged
Soph merged 8 commits intomainfrom
soph/add-ci-and-lint
Apr 16, 2026
Merged

Add ci and lint move to camelCase JSON#7
Soph merged 8 commits intomainfrom
soph/add-ci-and-lint

Conversation

@Soph
Copy link
Copy Markdown
Contributor

@Soph Soph commented Apr 16, 2026

  • get all linting to be green as a base line
  • add proper ci jobs
  • make JSON output consitent camelCase

Note

Medium Risk
Changes the public JSON output shape from snake_case to camelCase, which is a breaking change for any consumers. Also touches core git protocol/strategy codepaths with expanded error wrapping and stricter error handling, which could surface new failures in edge cases.

Overview
Adds GitHub Actions workflows for test, lint (including golangci-lint), and a reusable license check, plus a repo-wide .golangci.yaml to baseline linting.

Standardizes all CLI/embedding JSON output fields to camelCase (updates struct tags, docs, and tests/bench JSON assertions), and tightens error handling across auth/token storage, git protocol fetch/push, planner, and strategies by wrapping/propagating errors and handling write/close failures more explicitly (introducing testify/require for cleaner test assertions).

Reviewed by Cursor Bugbot for commit 740c935. Configure here.

Soph and others added 8 commits April 16, 2026 11:47
Add GitHub Actions PR gates matching the CLI repo pattern:
- ci.yml: tests with -race detection on PRs and push to main
- lint.yml: golangci-lint (60+ linters) with inline PR annotations,
  gofmt, go mod tidy, and shellcheck checks
- license-check.yml: reusable license compliance from entireio/shared

Add .golangci.yaml with full linter config adapted from CLI, and
mise-tasks/lint/ scripts for local development parity.

Fix all 340 existing lint violations across 51 files:
- wrapcheck: wrap external/interface errors with descriptive context
- perfsprint: errors.New for static strings, string concat for Sprintf
- errcheck: handle or explicitly acknowledge error returns
- intrange: modernize for loops to range-over-int (Go 1.22+)
- embeddedstructfieldcheck: separate embedded from regular struct fields
- inamedparam: name interface method parameters
- exhaustive: add missing switch cases
- errorlint: use errors.Is() instead of == for wrapped error checks
- revive: rename unused parameters to _
- goconst: extract repeated string literals into constants
- gocritic: restructure if-else chains and duplicate branches
- noctx: use CommandContext/NewRequestWithContext
- staticcheck: replace nil contexts with t.Context()
- usestdlibvars: use http.MethodGet instead of "GET"

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: 79aa4e9d44f3
Convert all existing snake_case JSON tags to camelCase and add
camelCase tags to previously untagged public API types. This
establishes a consistent JSON convention across the codebase
following standard Go ecosystem practices.

Output types (Result, ProbeResult, FetchResult, BranchPlan, etc.)
and input types (Endpoint, RefMapping, SyncPolicy, etc.) now all
use camelCase. Custom MarshalJSON methods updated to match.

Auth/OAuth response structs in internal/auth/entiredb.go are
intentionally left unchanged as they match external API formats.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: edd7327765fb
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: fac14075b0f9
The PR head SHA ref is unset on push and workflow_dispatch events.
Default checkout behavior already does the right thing for all
trigger types.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: c8daabe68860
- actions/checkout: v6.0.2 (de0fac2)
- actions/setup-go: v6.4.0 (4a36011)
- jdx/mise-action: v4.0.1 (1648a78)
- golangci/golangci-lint-action: v9.2.0 (1e7e51e)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: 0c0a06d11517
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: 09ff645640b1
Adds mise lint:licenses task and .allowed-licenses baseline,
matching the CLI repo's license check pattern. Required by the
shared entireio/shared license-check-reusable workflow.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: 52e0c0e2ab5e
Set GIT_TERMINAL_PROMPT=0 so tests that fall through to the
system git credential helper fail fast instead of blocking on
stdin.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: 71872426c9cd
@Soph Soph merged commit a9a36b4 into main Apr 16, 2026
3 checks passed
@Soph Soph deleted the soph/add-ci-and-lint branch April 16, 2026 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants