2.5 KiB
2.5 KiB
Agent Guidelines for ezcache
This document outlines the conventions and commands for agents operating within the ezcache Go project.
Build/Lint/Test Commands
- Build:
go build ./... - 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/ezcache - Go version: 1.23.7
- Imports: Group standard library imports separately from third-party imports.
- Formatting: Adhere to
go fmtstandards. - Naming Conventions:
- Variables:
camelCase - Functions/Methods:
CamelCase(exported),camelCase(unexported) - Packages:
lowercase
- Variables:
- Error Handling: Return errors explicitly. Check errors immediately after a function call that returns an error.
- Types: Use generics where appropriate, as seen in
ezcache.go. - Concurrency: Use
sync.RWMutexfor concurrent map access, as demonstrated inezcache.go. - Linter Rules: Refer to
.golangci.yamlfor 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
developbranch or appropriate feature branches - Branch prefixes:
feat/feature-name- New features, merge todevelopwhen completebug/bug-name- Bug fixes (non-urgent), merge todevelopwhen completerel/version- Release preparation branches, merge tostableand then also mergestableback todevelophot/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
stablebranch (only merge fromrel/orhot/branches) - After merging to
stable, always merge it back todevelop - Before starting work: Ensure you're on
developbranch or create an appropriate feature branch from it