Instruction file imported from ethpandaops/ethcore (
.cursor/rules/development_workflow.mdc). Copyright stays with the author.
ETHCore Development Workflow
Git Workflow
Branching Strategy
- Main branch:
master- stable, production-ready code - Feature branches: Create from master, prefix with type:
feat/- New featuresfix/- Bug fixesrefactor/- Code refactoringtest/- Test improvementsdocs/- Documentation updateschore/- Maintenance tasks
Commit Messages
- Use conventional commit format:
type(scope): description - Types: feat, fix, docs, style, refactor, test, chore
- Keep the first line under 72 characters
- Use present tense ("add feature" not "added feature")
- Reference issues when applicable
Pull Requests
- Create PR from feature branch to master
- Ensure all CI checks pass before merging
- Include clear description of changes
- Reference related issues
- Squash commits when merging
Testing Requirements
Before Committing
- Run tests locally:
go test ./... - Run linter:
golangci-lint run - Ensure no typos (CI will check)
- Verify code formatting:
gofmt -s -w .
Test Coverage
- Write tests for all new functionality
- Maintain or improve existing coverage
- Focus on testing critical paths and edge cases
- Use table-driven tests for comprehensive coverage
Integration Tests
- Test interactions with Ethereum nodes when possible
- Use test fixtures for predictable results
- Mock external dependencies appropriately
CI/CD Pipeline
GitHub Actions Workflows
- check-typos.yml: Checks for typos in code and documentation
- golangci-lint.yaml: Runs comprehensive Go linting
- gotest.yaml: Runs all tests with race detection
CI Requirements
- All checks must pass for PR approval
- Tests run on multiple Go versions
- Race condition detection enabled
- Linting with strict configuration
Code Review Guidelines
For Contributors
- Self-review before requesting review
- Respond to feedback constructively
- Update PR based on review comments
- Keep PRs focused and reasonably sized
For Reviewers
- Check for adherence to code standards
- Verify test coverage
- Ensure documentation is updated
- Consider performance implications
- Review for security issues
Release Process
Versioning
- Follow semantic versioning (semver)
- Tag releases on master branch
- Document breaking changes
Release Checklist
- Update version in relevant files
- Update CHANGELOG if present
- Run full test suite
- Create release tag
- Generate release notes
Development Environment
Required Tools
- Go 1.24.0 or later
- golangci-lint (latest version)
- git
Recommended Setup
- Use Go modules for dependency management
- Enable Go module proxy for faster downloads
- Configure IDE/editor with Go support
- Install pre-commit hooks if available
Dependency Management
Adding Dependencies
- Use
go getto add new dependencies - Run
go mod tidyto clean up - Commit both go.mod and go.sum
- Justify new dependencies in PR
Updating Dependencies
- Use
go get -ufor updates - Test thoroughly after updates
- Update one major dependency at a time
- Document any breaking changes
Performance Considerations
Profiling
- Profile before optimizing
- Use Go's built-in profiling tools
- Focus on hot paths identified by profiling
- Benchmark critical functions
Monitoring
- Add metrics for important operations
- Use appropriate logging levels
- Consider resource usage in design