Skip to content

ci(go): enforce gofmt for CLI and agent - #154

Merged
rodriguecyber merged 2 commits into
Open-Source-Kigali:developfrom
bonheur15:fix/111-gofmt-ci
Aug 28, 2026
Merged

ci(go): enforce gofmt for CLI and agent#154
rodriguecyber merged 2 commits into
Open-Source-Kigali:developfrom
bonheur15:fix/111-gofmt-ci

Conversation

@bonheur15

Copy link
Copy Markdown
Contributor

Summary

  • format the CLI and agent Go sources with gofmt
  • add fail-closed formatting checks to both Go CI workflows
  • keep formatting and CI enforcement in separate commits for reviewability

The issue originally named six files. On current develop, gofmt -l apps/cli apps/agent reported nineteen files because additional committed CRLF sources were also non-canonical to gofmt; this PR normalizes all reported files so the new check starts green.

Type of change

  • Bug fix
  • New feature
  • Refactor / cleanup
  • Docs
  • Infrastructure / CI
  • Breaking change

Areas touched

  • apps/server (NestJS)
  • apps/web (React / Vite)
  • apps/agent (Go)
  • packages/protocol (shared WebSocket contracts)
  • apps/cli (Go)
  • .github/workflows

Related issue

Closes #111

Validation

  • gofmt -l apps/cli apps/agent — clean
  • CLI: go vet ./..., go build ./..., go test ./...
  • Agent: go mod tidy plus clean module diff, go vet ./..., go build ./..., go test ./...
  • CLI cross-compilation: Linux amd64/arm64, macOS amd64/arm64, Windows amd64
  • Agent cross-compilation: Linux amd64/arm64, Windows amd64, macOS arm64
  • Both workflow YAML files parsed locally
  • Formatting guard negative-path test: an intentionally unformatted Go probe was detected and exited non-zero
  • git diff --check upstream/develop...HEAD

Checklist

  • Change is focused and stays within the existing module boundaries.
  • Formatting-only changes are isolated from CI changes.
  • Relevant checks pass locally.
  • No application behavior or dependencies changed.

@bonheur15

bonheur15 commented Aug 28, 2026

Copy link
Copy Markdown
Contributor Author

Note about the large formatting commit

Most of this diff is caused by gofmt changing Windows-style CRLF line endings to LF. GitHub therefore shows many unchanged lines as removed and added. There are no intentional logic changes.

I formatted all 19 files reported by gofmt; otherwise, the new CI formatting check would fail immediately. The formatting and CI changes are kept in separate commits for easier review.

This should be safe to merge: CLI and Agent tests, builds, vet checks, cross-platform builds, and both GitHub Actions jobs pass. If the maintainers prefer to handle line endings separately, I am happy to adjust the PR.

@rodriguecyber
rodriguecyber merged commit 82eeb7b into Open-Source-Kigali:develop Aug 28, 2026
2 checks passed
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.

Six Go files are not gofmt-formatted, and CI never checks

2 participants