Contributing to WeOS
Thank you for your interest in contributing to WeOS.
Development Workflow
- Fork the repository and clone your fork
- Create a feature branch from
main - Make your changes following the code standards below
- Write or update tests for your changes
- Run
make testto ensure all tests pass - Run
make lintto check for linting issues - Submit a pull request against
main
Code Standards
- Follow Go conventions and idioms
- Aim for functions under 100 lines / 50 statements
- Aim for maximum line length of 120 characters
- Aim for cyclomatic complexity under 15
- Use
goimportsfor import formatting (make fmt) - Enabled linters:
errcheck,govet,ineffassign,staticcheck,unused,misspell
Testing
- Unit tests go in
tests/unit/ - Integration tests go in
tests/integration/ - End-to-end tests go in
tests/e2e/ - Run the full suite:
make test(includes race detection and coverage) - Run a single test:
go test -v -run TestName ./path/to/package
Event Sourcing Patterns
When working with domain entities:
- Never persist entities directly — always use
SimpleUnitOfWork - Events are immutable — never modify events after creation
- Event handlers must be idempotent — they may be replayed
- Record events in entity methods, not in services
Architecture
Dependencies point inward: API -> Application -> Domain <- Infrastructure
See the Architecture page and Explanation section for details.