From aa6f51690723dc7dbbf981eca23790109fcaeb7c Mon Sep 17 00:00:00 2001 From: Cory LaNou Date: Tue, 4 Nov 2025 16:48:23 -0600 Subject: [PATCH 1/4] add agents.md --- AGENTS.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 AGENTS.md diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..3dd959d --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,25 @@ +# Repository Guidelines + +## Project Structure & Module Organization + +Core packages live at repo root (e.g., `element.go`, `parser.go`) and follow Go's standard package-per-file pattern, each paired with `*_test.go`. The CLI wrapper sits in `cmd/hype`, which builds the `hype` binary. Content templates and examples live under `docs/`, `mdx/`, and `slides/`, while reusable fixtures are stored in `testdata/`. Helper utilities and adapters reside in `internal/` plus feature-specific subfolders such as `atomx/` and `binding/`. + +## Build, Test, and Development Commands + +- `make test`: runs `go test -count 1 -race -vet=off -cover` across all packages except generated docs. +- `make build`: produces a local `hype` binary from `cmd/hype/`. +- `go run ./cmd/hype --help`: inspect CLI options without installing. +- `make docs` or `make hype`: regenerate `README.md` from `hype.md`; run after changing documentation templates. +- `go install ./cmd/hype`: install the CLI into your `$GOBIN` for reuse in other projects. + +## Coding Style & Naming Conventions + +Use Go 1.22+ features conservatively and keep compiler warnings at zero. Format code via `gofmt` (tabs for indentation, blank lines between logical sections) and lint with `revive` using `revive.toml`. Exported identifiers should read like `Parser`, `ExecuteError`, while private helpers stay lowerCamel. Keep package boundaries focused; avoid cyclic imports by adding shared helpers to `internal/`. + +## Testing Guidelines + +Unit tests mirror their source files (e.g., `figure_test.go`) and should cover happy paths plus failure parsing cases. Add integration coverage for the CLI in `cli_integration_test.go` when touching command behavior. Run `make cov` to inspect HTML coverage locally and target meaningful assertions rather than snapshot dumps. Table-driven tests are preferred; name cases with short strings describing the scenario. All new features require a failing test before implementation when practical. + +## Commit & Pull Request Guidelines + +Follow the existing history style: short imperative subject plus optional PR reference, e.g., `Fix non-deterministic JSON output (#46)`. Group related changes into one commit and keep generated files (like `README.md`) in the same commit when they stem from code changes. Pull requests should link issues, describe the behavior change, list verification steps (`make test`, `go run examples/...`), and include screenshots when user-facing output changes. Ensure CI (GitHub Actions `tests.yml`) passes before requesting review. From 3bb803daac809f544eb7d52d528f377fbdcde4c4 Mon Sep 17 00:00:00 2001 From: Cory LaNou Date: Tue, 4 Nov 2025 16:49:42 -0600 Subject: [PATCH 2/4] go 1.25+ --- AGENTS.md | 2 +- go.mod | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 3dd959d..41d4214 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -14,7 +14,7 @@ Core packages live at repo root (e.g., `element.go`, `parser.go`) and follow Go' ## Coding Style & Naming Conventions -Use Go 1.22+ features conservatively and keep compiler warnings at zero. Format code via `gofmt` (tabs for indentation, blank lines between logical sections) and lint with `revive` using `revive.toml`. Exported identifiers should read like `Parser`, `ExecuteError`, while private helpers stay lowerCamel. Keep package boundaries focused; avoid cyclic imports by adding shared helpers to `internal/`. +Use Go 1.25+ features conservatively and keep compiler warnings at zero. Format code via `gofmt` (tabs for indentation, blank lines between logical sections) and lint with `revive` using `revive.toml`. Exported identifiers should read like `Parser`, `ExecuteError`, while private helpers stay lowerCamel. Keep package boundaries focused; avoid cyclic imports by adding shared helpers to `internal/`. ## Testing Guidelines diff --git a/go.mod b/go.mod index d5cdc04..a0b5b3a 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,8 @@ module github.com/gopherguides/hype -go 1.24 +go 1.25 -toolchain go1.24.0 +toolchain go1.25.0 require ( github.com/gobuffalo/flect v1.0.2 From 986c2772b1a7f93440c3c1a20134b9275b0aa54b Mon Sep 17 00:00:00 2001 From: Cory LaNou Date: Tue, 4 Nov 2025 16:56:15 -0600 Subject: [PATCH 3/4] chore(ci): use go.mod for Go version in CI workflows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace hardcoded Go versions (1.24.x) with go-version-file: 'go.mod' in all GitHub Actions workflows. This ensures CI uses the same Go version (1.25) specified in go.mod, eliminating version drift and providing a single source of truth. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .github/workflows/hype.yml | 2 +- .github/workflows/release.yml | 2 +- .github/workflows/tests.yml | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/hype.yml b/.github/workflows/hype.yml index e040458..4d018d1 100644 --- a/.github/workflows/hype.yml +++ b/.github/workflows/hype.yml @@ -16,7 +16,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v4 with: - go-version: "1.24.x" + go-version-file: 'go.mod' cache-dependency-path: subdir/go.sum - name: Install hype run: go install github.com/gopherguides/hype/cmd/hype@latest diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1e00fe4..783c8f0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,7 +17,7 @@ jobs: fetch-depth: 0 - uses: actions/setup-go@v4 with: - go-version: "1.24.x" + go-version-file: 'go.mod' cache-dependency-path: go.sum - uses: goreleaser/goreleaser-action@v6 with: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index af6395b..b5aa322 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -6,18 +6,17 @@ on: pull_request: jobs: tests-on: - name: ${{matrix.go-version}} ${{matrix.os}} + name: ${{matrix.os}} runs-on: ${{ matrix.os }} strategy: matrix: - go-version: [1.24.x] os: [macos-latest, ubuntu-latest] steps: - uses: actions/checkout@v4 - name: Set up Go uses: actions/setup-go@v4 with: - go-version: "1.24.x" + go-version-file: 'go.mod' - name: Go Environment run: go env - name: Verify Go Modules From 3616ca674e8db956525a16f4e870dff0fa91d9b2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 4 Nov 2025 22:56:59 +0000 Subject: [PATCH 4/4] Update README.md with latest Hype changes --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 2f7d34f..f74b53f 100644 --- a/README.md +++ b/README.md @@ -127,7 +127,7 @@ $ go run . Hello World -------------------------------------------------------------------------------- -Go Version: go1.24.9 +Go Version: go1.25.3 ``` @@ -160,7 +160,7 @@ $ go run . Hello World -------------------------------------------------------------------------------- -Go Version: go1.24.9 +Go Version: go1.25.3 ``` @@ -189,7 +189,7 @@ $ go run . Hello World -------------------------------------------------------------------------------- -Go Version: go1.24.9 +Go Version: go1.25.3 ``` @@ -219,7 +219,7 @@ $ go run . ./main.go:7:6: undefined: fmt.Prin -------------------------------------------------------------------------------- -Go Version: go1.24.9 +Go Version: go1.25.3 ``` @@ -256,7 +256,7 @@ type Context interface{ ... } func WithoutCancel(parent Context) Context -------------------------------------------------------------------------------- -Go Version: go1.24.9 +Go Version: go1.25.3 ``` @@ -279,7 +279,7 @@ func WithCancel(parent Context) (ctx Context, cancel CancelFunc) call cancel as soon as the operations running in this Context complete. -------------------------------------------------------------------------------- -Go Version: go1.24.9 +Go Version: go1.25.3 ``` @@ -427,7 +427,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v4 with: - go-version: "1.24.x" + go-version-file: 'go.mod' cache-dependency-path: subdir/go.sum - name: Install hype run: go install github.com/gopherguides/hype/cmd/hype@latest