chore: adopt Go library-quality standard (format, lint, coverage, docs)#2
Draft
AndroidPoet wants to merge 1 commit into
Draft
chore: adopt Go library-quality standard (format, lint, coverage, docs)#2AndroidPoet wants to merge 1 commit into
AndroidPoet wants to merge 1 commit into
Conversation
Apply a four-pillar quality baseline to the project. Formatting - Adopt gofumpt as the canonical formatter and reformat the codebase. - Add make fmt / make fmt-check targets and a CI gofumpt gate. Linting - Expand .golangci.yml (v2) to a sensible default set: govet, staticcheck, errcheck, ineffassign, unused, gofumpt, goimports, plus bodyclose, noctx, nilerr, errorlint, gocritic, prealloc, whitespace, misspell, unconvert, revive. - Fix all surfaced issues so the linter passes clean (errcheck, noctx, capitalized errors, deprecated strings.Title, dead assignments, etc.). - Run golangci-lint in CI via the official action. Coverage - Wire go test with -coverprofile/-covermode=atomic. - Add make cover (HTML + func reports) and make cover-func targets. - Add a coverage step + artifact upload to CI. Docs - Add a Next.js documentation site under website/ with project-specific content: introduction, installation, getting started, usage, command reference, configuration, and output/scripting guides. - Replace the previous docs pipeline; deploy the static export to Pages.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Brings the project up to a Go library-quality baseline across four pillars: formatting, linting/static analysis, test-coverage tooling, and a documentation website. No runtime behavior changes — the source edits are lint/format fixes that preserve existing logic.
Pillars
1. Formatting — gofumpt
gofumptas the canonical formatter and reformatted the whole codebase.make fmt(write) andmake fmt-check(CI-style gate) targets added.2. Linting / static analysis — golangci-lint
.golangci.yml(schema v2) from 2 linters to a sensible default set:govet,staticcheck,errcheck,ineffassign,unused, plusbodyclose,noctx,nilerr,errorlint,gocritic,prealloc,whitespace,misspell,unconvert,revive, withgofumpt+goimportsas formatters.exec.Command→exec.CommandContext, capitalized error strings, a deprecatedstrings.Titlecall, a dead assignment, prealloc, and more.golangci-lintvia the official action.3. Test coverage
go test ./... -coverprofile=coverage.out -covermode=atomicwired into amake covertask that emits both an HTML report and a per-function summary (plusmake cover-func).coverage.outas an artifact.internal/cliandinternal/outputhave tests). This PR wires up the tooling; broadening test coverage is intentionally out of scope and left as follow-up.4. Docs site
website/(static export, served from GitHub Pages under the repo sub-path).Verification (run locally)
gofumpt -l .go build ./...go vet ./...go test ./...golangci-lint run ./...make coverpnpm buildNotes
go mod tidypromotedgolang.org/x/textto a direct dependency (used to replace deprecatedstrings.Title).