✨ Initial project setup with basic scaffolding, build tools, and agent guidelines.
This commit is contained in:
parent
f4a95feb60
commit
8c595a9080
6 changed files with 142 additions and 0 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
build/
|
||||
39
.golangci.yaml
Normal file
39
.golangci.yaml
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
version: "2"
|
||||
|
||||
linters:
|
||||
enable:
|
||||
- errcheck
|
||||
- govet
|
||||
- ineffassign
|
||||
- staticcheck
|
||||
- unused
|
||||
- copyloopvar
|
||||
- dupl
|
||||
- err113
|
||||
- errname
|
||||
- exptostd
|
||||
- fatcontext
|
||||
- funlen
|
||||
- gocognit
|
||||
- goconst
|
||||
- gocritic
|
||||
- gocyclo
|
||||
- godot
|
||||
- godox
|
||||
- gosec
|
||||
- perfsprint
|
||||
- testifylint
|
||||
settings:
|
||||
testifylint:
|
||||
enable-all: true
|
||||
disable:
|
||||
- require-error
|
||||
gocognit:
|
||||
min-complexity: 16
|
||||
gocyclo:
|
||||
min-complexity: 15
|
||||
gocritic:
|
||||
enable-all: true
|
||||
settings:
|
||||
hugeParam:
|
||||
sizeThreshold: 255
|
||||
1
.task/checksum/fmt
Normal file
1
.task/checksum/fmt
Normal file
|
|
@ -0,0 +1 @@
|
|||
99aa06d3014798d86001c324468d497f
|
||||
43
AGENTS.md
Normal file
43
AGENTS.md
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
# Agent Guidelines for waiterr
|
||||
|
||||
This document outlines the conventions and commands for agents operating within the `waiterr` Go project.
|
||||
|
||||
## Build/Lint/Test Commands
|
||||
|
||||
- **Lint:** `task lint`
|
||||
- **Test All:** `task test`
|
||||
- **Test Single File:** `go test -run <TestName> <path/to/file_test.go>` (e.g., `go test -run TestNewHappy ./ezcache_test.go`)
|
||||
- **Format:** `task fmt`
|
||||
|
||||
## Code Style Guidelines
|
||||
|
||||
- **Module**: `codeberg.org/danjones000/waiterr`
|
||||
- **Go version**: 1.24.9
|
||||
- **Imports:** Group standard library imports separately from third-party imports.
|
||||
- **Formatting:** Adhere to `go fmt` standards.
|
||||
- **Naming Conventions:**
|
||||
- Variables: `camelCase`
|
||||
- Functions/Methods: `CamelCase` (exported), `camelCase` (unexported)
|
||||
- Packages: `lowercase`
|
||||
- **Error Handling:** Return errors explicitly. Check errors immediately after a function call that returns an error.
|
||||
- **Linter Rules:** Refer to `.golangci.yaml` for detailed linting rules.
|
||||
- **Testing**: Use `github.com/nalgeon/be`
|
||||
|
||||
## Git Commit Guidelines
|
||||
- **Format**: Prepend commit messages with a gitmoji emoji (see https://gitmoji.dev)
|
||||
- **Style**: Write detailed commit messages that explain what changed and why
|
||||
- **Examples**: `✨ Add JSON export functionality for log entries`, `🐛 Fix date parsing for RFC3339 timestamps`, `📝 Update README with configuration examples`
|
||||
|
||||
## Git Flow Workflow
|
||||
- **Main branches**: `stable` (production-ready), `develop` (integration branch)
|
||||
- **Development**: Always commit new features/fixes to `develop` branch or appropriate feature branches
|
||||
- **Branch prefixes**:
|
||||
- `feat/feature-name` - New features, merge to `develop` when complete
|
||||
- `bug/bug-name` - Bug fixes (non-urgent), merge to `develop` when complete
|
||||
- `rel/version` - Release preparation branches, merge to `stable` and then **also** merge `stable` back to `develop`
|
||||
- `hot/version` - Hotfixes for production issues follow same merge rules as releases
|
||||
- **Version tags**: Prefix all version tags with `v` (e.g., `v1.0.2`, `v0.0.6`)
|
||||
- **Releases**: Update CHANGELOG.md with a summary of changes for each new version
|
||||
- **Never commit directly to** `stable` branch (only merge from `rel/` or `hot/` branches)
|
||||
- After merging to `stable`, always merge it back to `develop`
|
||||
- **Before starting work**: Ensure you're on `develop` branch or create an appropriate feature branch from it
|
||||
55
Taskfile.yml
Normal file
55
Taskfile.yml
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
version: '3'
|
||||
|
||||
tasks:
|
||||
default:
|
||||
cmds:
|
||||
- task: fmt
|
||||
- task: test
|
||||
- task: lint
|
||||
|
||||
fmt:
|
||||
desc: Format go code
|
||||
sources:
|
||||
- '**/*.go'
|
||||
cmds:
|
||||
- go fmt ./...
|
||||
- go mod tidy
|
||||
|
||||
lint:
|
||||
desc: Do static analysis
|
||||
sources:
|
||||
- '**/*.go'
|
||||
cmds:
|
||||
- golangci-lint run
|
||||
|
||||
test:
|
||||
desc: Run unit tests
|
||||
deps: [fmt]
|
||||
sources:
|
||||
- '**/*.go'
|
||||
generates:
|
||||
- build/cover.out
|
||||
cmds:
|
||||
- go test -race -cover -coverprofile build/cover.out ./...
|
||||
|
||||
coverage-report:
|
||||
desc: Build coverage report
|
||||
deps: [test]
|
||||
sources:
|
||||
- build/cover.out
|
||||
generates:
|
||||
- build/cover.html
|
||||
cmds:
|
||||
- go tool cover -html=build/cover.out -o build/cover.html
|
||||
|
||||
serve-report:
|
||||
desc: Serve the coverage report
|
||||
deps: [coverage-report]
|
||||
cmds:
|
||||
- ip addr list | grep inet
|
||||
- python3 -m http.server -d build 3434
|
||||
|
||||
serve-docs:
|
||||
desc: Serve the current docs
|
||||
cmds:
|
||||
- godoc -http=0.0.0.0:3434 -play
|
||||
3
go.mod
Normal file
3
go.mod
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
module codeberg.org/danjones000/waiterr
|
||||
|
||||
go 1.24.9
|
||||
Loading…
Add table
Add a link
Reference in a new issue