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 diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..41d4214 --- /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.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 + +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. 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 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