Thank you for your interest in contributing to mailcli! Contributions are welcome!
- Go 1.24 or higher
- Basic knowledge of Go and IMAP protocol
- Familiarity with command-line tools
# Fork and clone the repository
git clone https://github.com/YOUR_USERNAME/mailcli.git
cd mailcli
# Add upstream remote
git remote add upstream https://github.com/keepmind9/mailcli.git
# Install dependencies
go mod download
# Run tests to verify setup
make test-
Create a feature branch
git checkout -b feature/your-feature-name
-
Make your changes
- Write code following the project structure
- Add tests for new features
- Update documentation as needed
-
Run tests
make test -
Format code
make fmt
-
Commit your changes
git add . git commit -m "feat: add your feature"
-
Push to your fork
git push origin feature/your-feature-name
-
Open a Pull Request
- Describe your changes clearly
- Reference related issues
- Ensure all CI checks pass
We follow Conventional Commits:
feat:- New featurefix:- Bug fixdocs:- Documentation changesrefactor:- Code refactoringtest:- Adding or updating testschore:- Build/tooling changesopt:- Performance optimizationsecurity:- Security fixes
Examples:
feat: add support for custom IMAP ports
fix: handle connection timeout gracefully
docs: update installation instructions
test: add tests for IMAP connection pooling
- Follow Effective Go guidelines
- Use
gofmtfor formatting (enforced by pre-commit hook) - Write meaningful variable and function names
- Keep functions small and focused
- Write tests for all new features
- Maintain test coverage above 50%
- Use table-driven tests for multiple scenarios
- Mock external dependencies (IMAP servers)
Example test:
func TestSearchCriteria(t *testing.T) {
tests := []struct {
name string
criteria *SearchCriteria
want int
}{
{
name: "search unread emails",
criteria: &SearchCriteria{
UnreadOnly: true,
},
want: 5,
},
// ... more test cases
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
// Test implementation
})
}
}- Add godoc comments for exported functions
- Update README.md for user-facing changes
- Update README.zh-CN.md for Chinese documentation
- Include examples in documentation
- Check existing issues for bug reports
- Create a new issue if none exists
- Include steps to reproduce
- Add tests that fail without the fix
- Submit the fix with tests
- Open an issue to discuss the feature first
- Get feedback from maintainers
- Implement the feature with tests
- Update documentation
- Submit a pull request
- Fix typos and grammar
- Improve clarity of explanations
- Add more examples
- Translate documentation to other languages
- Profile the code to identify bottlenecks
- Propose changes with benchmarks
- Show before/after performance metrics
Use conventional commit format:
feat: add TEXT search support
fix: handle IMAP connection timeout
docs: update README with new features
Include:
- What changes were made
- Why the changes are needed
- How the changes work
- Testing done
- Screenshots (if applicable)
- Automated checks (CI) must pass
- Code review by maintainers
- Address review feedback
- Squash commits if needed
- Merge into main branch
Include:
- mailcli version (
mailcli version) - OS and architecture
- Steps to reproduce
- Expected behavior
- Actual behavior
- Error messages or logs
Include:
- Clear description of the feature
- Use case or problem it solves
- Proposed solution (if any)
- Alternative approaches considered
- Be respectful and constructive
- Welcome newcomers and help them learn
- Focus on what is best for the community
- Show empathy towards other community members
- Check existing documentation
- Search existing issues
- Ask questions in issues or discussions
- Join community discussions
Contributors will be:
- Listed in the contributors section
- Acknowledged in release notes
- Credited in significant contributions
Thank you for contributing to mailcli! 🎉