feat: add blueprint compliance (CI, goreleaser, errfmt, linting)#2
feat: add blueprint compliance (CI, goreleaser, errfmt, linting)#2itsjeremyjohnson merged 3 commits intomainfrom
Conversation
Add standard project infrastructure files following the clickup-cli blueprint: - AGENTS.md with project structure and dev commands - .github/workflows/ci.yml (ubuntu-only, Go 1.25) - .goreleaser.yaml (linux + darwin, CGO_ENABLED=0, homebrew tap) - .golangci.yml with full linter config and exclusions for pre-existing debt - internal/errfmt/ package for user-friendly error formatting - Updated Makefile with tools, fmt, fmt-check, ci targets - Updated version command with --json/--plain output, commit, and date - Updated main.go with commit/date ldflags and errfmt integration - Applied gofumpt/goimports formatting across entire codebase - Added .tools/ to .gitignore Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
.github/workflows/ci.yml
Outdated
| - name: Set up Go | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| go-version: '1.25' |
There was a problem hiding this comment.
CI uses Go 1.25 but go.mod requires 1.25.1
| go-version: '1.25' | |
| go-version: '1.25.1' |
Prompt To Fix With AI
This is a comment left during a code review.
Path: .github/workflows/ci.yml
Line: 18:18
Comment:
CI uses Go `1.25` but `go.mod` requires `1.25.1`
```suggestion
go-version: '1.25.1'
```
How can I resolve this? If you propose a fix, please make it concise.There was a problem hiding this comment.
Not an issue — setup-go with go-version: '1.25' installs the latest 1.25.x patch release (currently 1.25.1+), which satisfies the go.mod toolchain requirement. Using the minor version prefix is the recommended pattern for CI.
There was a problem hiding this comment.
👍 Accurate — fixed in e9f4b93. Updated to 1.25.1 to match go.mod exactly.
There was a problem hiding this comment.
👎 While setup-go does resolve 1.25 to latest patch, pinning 1.25.1 in CI avoids drift and matches go.mod exactly. Explicit is better.
Fix goconst lint failure in CI. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
internal/adapter/standard.go
Outdated
|
|
||
| // shellQuote wraps a string in single quotes for safe shell usage. | ||
| // Single quotes inside the string are escaped as '\'' (end quote, escaped | ||
| // Single quotes inside the string are escaped as '\” (end quote, escaped |
There was a problem hiding this comment.
Comment corrupted by formatter
The formatter mangled the shell-escape documentation. The original '\'' (end-quote, escaped literal quote, start-quote) accurately describes the shellQuote implementation on line 95 (result += "'\\''"), but the new text '\" is incorrect and misleading.
| // Single quotes inside the string are escaped as '\” (end quote, escaped | |
| // Single quotes inside the string are escaped as '\'' (end quote, escaped |
Prompt To Fix With AI
This is a comment left during a code review.
Path: internal/adapter/standard.go
Line: 89:89
Comment:
**Comment corrupted by formatter**
The formatter mangled the shell-escape documentation. The original `'\''` (end-quote, escaped literal quote, start-quote) accurately describes the `shellQuote` implementation on line 95 (`result += "'\\''"`), but the new text `'\"` is incorrect and misleading.
```suggestion
// Single quotes inside the string are escaped as '\'' (end quote, escaped
```
How can I resolve this? If you propose a fix, please make it concise.There was a problem hiding this comment.
👍 Accurate — gofumpt actively mangles the backslash-quote sequence in comments. Rewrote the doc comment to use a gofumpt-stable format with a code block example. Fixed in e9f4b93.
Makefile
Outdated
| fmt-check: tools | ||
| @$(GOIMPORTS) -local github.com/builtbyrobben/wpssh -w . | ||
| @$(GOFUMPT) -w . | ||
| @git diff --exit-code -- '*.go' go.mod go.sum |
There was a problem hiding this comment.
fmt-check mutates files before diffing
The -w flag rewrites files in place, then relies on git diff --exit-code to detect changes. This works but is fragile in CI — if the checkout already has modifications (e.g. from a previous step), the rewrite could mask issues. A safer approach is to use -l (list) mode, which prints unformatted files without modifying them:
| fmt-check: tools | |
| @$(GOIMPORTS) -local github.com/builtbyrobben/wpssh -w . | |
| @$(GOFUMPT) -w . | |
| @git diff --exit-code -- '*.go' go.mod go.sum | |
| fmt-check: tools | |
| @test -z "$$($(GOIMPORTS) -local github.com/builtbyrobben/wpssh -l .)" || { echo "goimports: files need formatting"; $(GOIMPORTS) -local github.com/builtbyrobben/wpssh -l .; exit 1; } | |
| @test -z "$$($(GOFUMPT) -l .)" || { echo "gofumpt: files need formatting"; $(GOFUMPT) -l .; exit 1; } |
Prompt To Fix With AI
This is a comment left during a code review.
Path: Makefile
Line: 52:55
Comment:
**`fmt-check` mutates files before diffing**
The `-w` flag rewrites files in place, then relies on `git diff --exit-code` to detect changes. This works but is fragile in CI — if the checkout already has modifications (e.g. from a previous step), the rewrite could mask issues. A safer approach is to use `-l` (list) mode, which prints unformatted files without modifying them:
```suggestion
fmt-check: tools
@test -z "$$($(GOIMPORTS) -local github.com/builtbyrobben/wpssh -l .)" || { echo "goimports: files need formatting"; $(GOIMPORTS) -local github.com/builtbyrobben/wpssh -l .; exit 1; }
@test -z "$$($(GOFUMPT) -l .)" || { echo "gofumpt: files need formatting"; $(GOFUMPT) -l .; exit 1; }
```
How can I resolve this? If you propose a fix, please make it concise.There was a problem hiding this comment.
👍 Accurate — fmt-check now uses gofumpt -l and goimports -l (list mode) instead of -w (write mode). CI no longer mutates the working tree. Fixed in e9f4b93.
…check purity - ci.yml: match go-version to go.mod (1.25 -> 1.25.1) - standard.go: rewrite shellQuote doc comment to survive gofumpt (formatter was mangling backslash-quote sequences) - Makefile: fmt-check now uses -l (list) instead of -w (write) so CI never mutates the working tree before diffing Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Additional Comments (1)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time! |
Summary
Test plan
make cipasses (fmt-check, lint, test)🤖 Generated with Claude Code
Greptile Summary
This PR establishes comprehensive project infrastructure following a blueprint compliance pattern. The changes include CI/CD workflows, linting configuration, release automation, and error formatting improvements.
Key Changes
errfmtpackage for user-friendly error messages with Kong parse error enhancementsPrevious Thread Clarification
The previous comment about
fmt-checkmutating files is not accurate. The implementation correctly uses-l(list) flags for both goimports and gofumpt, which only list unformatted files without modifying them. This is the proper, safe approach for CI validation.Confidence Score: 5/5
internal/adapter/standard.goImportant Files Changed
Last reviewed commit: e9f4b93