Skip to content

feat: add blueprint compliance (CI, goreleaser, errfmt, linting)#2

Merged
itsjeremyjohnson merged 3 commits intomainfrom
feat/blueprint-compliance
Feb 28, 2026
Merged

feat: add blueprint compliance (CI, goreleaser, errfmt, linting)#2
itsjeremyjohnson merged 3 commits intomainfrom
feat/blueprint-compliance

Conversation

@itsjeremyjohnson
Copy link
Owner

@itsjeremyjohnson itsjeremyjohnson commented Feb 15, 2026

Summary

  • Add standard project infrastructure files following the clickup-cli blueprint
  • AGENTS.md: Project structure, build/test/lint commands, coding style, commit conventions
  • CI workflow: GitHub Actions with ubuntu-latest, Go 1.25 (fmt-check, lint, test)
  • GoReleaser config: linux + darwin targets, CGO_ENABLED=0, homebrew tap for wpgo
  • golangci-lint config: Full linter suite with exclusions for pre-existing code debt
  • errfmt package: User-friendly error formatting (Kong parse errors, UserFacingError type)
  • Makefile overhaul: Added tools, fmt, fmt-check, ci targets; commit/date in ldflags
  • Version command: Added --json and --plain output, commit hash, build date
  • main.go: Added commit/date ldflags, errfmt integration
  • Applied gofumpt/goimports formatting across entire codebase

Test plan

  • make ci passes (fmt-check, lint, test)
  • All 12 test packages pass
  • Zero lint issues with new golangci-lint config
  • New errfmt package compiles cleanly
  • Build succeeds with ldflags for version/commit/date

🤖 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

  • CI/CD: GitHub Actions workflow with Go 1.25.1, running fmt-check, lint, and tests
  • Tooling: golangci-lint with 40+ enabled linters and sensible exclusions for test files and legacy code
  • Release: GoReleaser configuration for multi-platform builds (linux/darwin, amd64/arm64) with homebrew tap support
  • Error Handling: New errfmt package for user-friendly error messages with Kong parse error enhancements
  • Version Info: Enhanced version command with JSON/plain output formats and build metadata (commit hash, date)
  • Documentation: AGENTS.md provides clear project structure and development guidelines
  • Formatting: Applied gofumpt/goimports across entire codebase for consistency

Previous Thread Clarification

The previous comment about fmt-check mutating 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

  • This PR is safe to merge with minimal risk
  • Infrastructure-focused PR with well-established tooling patterns, comprehensive linter coverage, and successful CI validation. The changes are additive (new files/configs) with minimal logic modifications. Test suite passes, zero lint issues reported, and formatting is consistent across the codebase.
  • No files require special attention beyond the previously-flagged comment accuracy issue in internal/adapter/standard.go

Important Files Changed

Filename Overview
.github/workflows/ci.yml New CI workflow with fmt-check, lint, and test steps using Go 1.25.1
.golangci.yml Comprehensive linter configuration with appropriate exclusions for test files and existing code
.goreleaser.yaml GoReleaser config for multi-platform builds with homebrew tap integration
Makefile Enhanced with tooling, formatting, linting targets, and proper ldflags for version info
internal/errfmt/errfmt.go New error formatting utility for user-friendly messages; no test coverage
cmd/wpgo/main.go Integrated errfmt and added commit/date ldflags variables
internal/cmd/version.go Enhanced version command with JSON/plain output and commit/date metadata

Last reviewed commit: e9f4b93

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>
Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

43 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.25'
Copy link

Choose a reason for hiding this comment

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

CI uses Go 1.25 but go.mod requires 1.25.1

Suggested change
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.

Copy link
Owner Author

Choose a reason for hiding this comment

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

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.

Copy link
Owner Author

Choose a reason for hiding this comment

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

👍 Accurate — fixed in e9f4b93. Updated to 1.25.1 to match go.mod exactly.

Copy link
Owner Author

Choose a reason for hiding this comment

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

👎 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>
Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

43 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile


// 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
Copy link

Choose a reason for hiding this comment

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

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.

Suggested change
// 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.

Copy link
Owner Author

Choose a reason for hiding this comment

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

👍 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
Comment on lines +52 to +55
fmt-check: tools
@$(GOIMPORTS) -local github.com/builtbyrobben/wpssh -w .
@$(GOFUMPT) -w .
@git diff --exit-code -- '*.go' go.mod go.sum
Copy link

Choose a reason for hiding this comment

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

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:

Suggested change
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.

Copy link
Owner Author

Choose a reason for hiding this comment

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

👍 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>
@itsjeremyjohnson itsjeremyjohnson merged commit b98402e into main Feb 28, 2026
2 checks passed
@itsjeremyjohnson itsjeremyjohnson deleted the feat/blueprint-compliance branch February 28, 2026 16:31
@greptile-apps
Copy link

greptile-apps bot commented Feb 28, 2026

Additional Comments (1)

internal/errfmt/errfmt.go, line 81
Consider adding unit tests for this package to verify error formatting behavior, especially for Kong parse errors and UserFacingError wrapping.

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!

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