🎉 Thank you for considering contributing to Poster!
- Code of Conduct
- Getting Started
- Development Workflow
- Coding Standards
- Commit Messages
- Pull Request Process
- Testing
- Documentation
This project follows our Code of Conduct. By participating, you are expected to uphold this code.
- Go 1.24 or higher
- Git
- A GitHub account
# Fork the repository on GitHub, then:
git clone https://github.com/YOUR_USERNAME/poster.git
cd poster
# Add upstream remote
git remote add upstream https://github.com/adcondev/poster.git# Install dependencies
go mod download
# Run tests
go test -v -race ./pkg/...
# Run linter
golangci-lint run
# Build examples
cd examples/basic
go build# Update your fork
git checkout main
git pull upstream main
# Create feature branch
git checkout -b feat/my-new-feature- Write clean, readable code
- Add tests for new features
- Update documentation as needed
- Follow existing code patterns
# Run tests
go test -v -race ./pkg/...
# Run benchmarks
go test -bench=. ./pkg/...
# Check coverage
go test -coverprofile=coverage.txt ./pkg/...
go tool cover -html=coverage.txt- Follow Effective Go
- Use
gofmtfor formatting - Pass
golangci-lintchecks - Keep functions small and focused
- Add comments for exported functions
// ProcessReceipt processes a receipt document and sends it to the printer.
// It returns an error if the document is invalid or printing fails.
func ProcessReceipt(doc *Document) error {
if err := doc.Validate(); err != nil {
return fmt.Errorf("invalid document: %w", err)
}
// ... implementation
}We follow Conventional Commits.
<type>(<scope>): <subject>
[optional body]
[optional footer]
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changes (formatting, etc.)refactor: Code refactoringperf: Performance improvementstest: Test additions or modificationsci: CI/CD changeschore: Other changes
feat(graphics): add dithering algorithm for image processing
fix(connection): resolve timeout issue on Windows 11
docs(readme): update installation instructions
test(composer): add unit tests for ESC/POS commandsSee Commit Guidelines for complete details.
- Tests pass locally
- Code follows style guidelines
- Documentation updated
- Commit messages follow conventions
- PR title follows conventional commits
- Push your branch to your fork
- Open a PR against
main - Fill out the PR template completely
- Link related issues
- Address review comments
- Keep PR focused and small
- Be responsive to feedback
- Update PR description as needed
# Update your fork
git checkout main
git pull upstream main
git push origin main
# Delete feature branch
git branch -d feat/my-new-feature
git push origin --delete feat/my-new-feature# Run all tests
go test ./pkg/...
# Run specific package
go test ./pkg/graphics/...
# Run with coverage
go test -coverprofile=coverage.txt ./pkg/...
# View coverage
go tool cover -html=coverage.txt# Run benchmarks
go test -bench=. -benchmem ./pkg/...
# Benchmark specific function
go test -bench=BenchmarkDithering ./pkg/graphics/# Run integration tests (if applicable)
go test -tags=integration ./test/integration/... - Document all exported functions, types, and constants
- Use complete sentences
- Include examples where helpful
// CreateProfile80mm creates a printer profile for standard 80mm thermal printers.
// It configures ESC/POS settings optimized for Epson TM-T88 and compatible models.
//
// Example:
//
// prof := profile.CreateProfile80mm()
// printer := service.NewPrinter(composer, prof, conn)
func CreateProfile80mm() *Profile {
// ...
}- Update README. md for user-facing changes
- Add examples for new features
- Update feature list when applicable
- API changes should be documented in
/api/v1/DOCUMENT_V1.md - Include JSON schema updates
- Provide usage examples
We use labels to organize issues:
bug- Something isn't workingenhancement- New feature or requestdocumentation- Documentation improvementsgood first issue- Good for newcomershelp wanted- Extra attention neededsecurity- Security-related issues
- Open a Discussion
- Ask in your PR/issue
- Check existing documentation
Your contributions make Poster better for everyone!
Happy coding! 🚀