Thank you for your interest in contributing to the M-Pesa iOS SDK. This document provides guidelines and instructions for contributing.
By participating in this project, you agree to maintain a respectful and inclusive environment for everyone.
- Check if the bug has already been reported in Issues
- If not, create a new issue with:
- Clear, descriptive title
- Steps to reproduce
- Expected vs actual behavior
- iOS version, Xcode version, and device/simulator info
- Code snippets if applicable
- Open an issue with the
enhancementlabel - Describe the feature and its use case
- Explain why it would benefit the SDK
- Fork the repository
- Create a feature branch (
git checkout -b feature/your-feature) - Make your changes
- Write or update tests as needed
- Ensure all tests pass and SwiftLint passes
- Update documentation if applicable
- Commit with clear, descriptive messages
- Push to your fork
- Open a Pull Request
- macOS Ventura or later
- Xcode 15+
- Swift 5.9+
- SwiftLint (
brew install swiftlint)
# Clone your fork
git clone https://github.com/Huss3n/ios-mpesa-sdk.git
# Navigate to project
cd ios-mpesa-sdk
# Copy environment template and add your credentials
cp .env.example .env
# Open in Xcode
open Package.swift# Run all tests
swift test
# Or in Xcode: Cmd+U# Check for issues
swiftlint
# Auto-fix issues where possible
swiftlint --fix- Follow Swift API Design Guidelines
- Use meaningful, descriptive names
- Keep functions focused and concise
- Prefer value types (structs) over reference types (classes) where appropriate
- Run SwiftLint before committing
All Swift files should include the standard header:
//
// FileName.swift
// MpesaSDK
//
// Created by [Author Name] on [Date].
//- Add documentation comments for all public APIs
- Use
///for documentation comments - Include code examples where helpful
- Write unit tests for new functionality
- Maintain or improve code coverage
- Mock external dependencies
- Integration tests require sandbox credentials in
.env
- Use present tense ("Add feature" not "Added feature")
- Use imperative mood ("Move cursor to..." not "Moves cursor to...")
- Keep the first line under 72 characters
- Reference issues when applicable
We use Semantic Versioning:
- MAJOR: Breaking API changes
- MINOR: New features (backwards compatible)
- PATCH: Bug fixes (backwards compatible)
To bump version:
./scripts/bump-version.sh patch # or minor, major- All PRs require at least one review
- Address review feedback promptly
- Keep PRs focused and reasonably sized
- Ensure CI passes before requesting review
Open an issue with the question label or reach out to the maintainers.
Thank you for contributing.