|
| 1 | +# Contributing to mParticle Apple SDK |
| 2 | + |
| 3 | +Thanks for contributing! Please read this document to follow our conventions for contributing to the mParticle SDK. |
| 4 | + |
| 5 | +## Setting Up |
| 6 | + |
| 7 | +1. Fork the repository and then clone down your fork |
| 8 | +2. Commit your code per the conventions below, and PR into the mParticle SDK main branch |
| 9 | +3. Your PR title will be checked automatically against the below convention (view the commit history to see examples of a proper commit/PR title). If it fails, you must update your title |
| 10 | +4. Our engineers will work with you to get your code change implemented once a PR is up |
| 11 | + |
| 12 | +## Development Process |
| 13 | + |
| 14 | +1. Create your branch from `main` |
| 15 | +2. Make your changes |
| 16 | +3. Add tests for any new functionality |
| 17 | +4. Run the test suite to ensure tests (both new and old) all pass |
| 18 | +5. Update the documentation |
| 19 | +6. Create a Pull Request |
| 20 | + |
| 21 | +### Pull Requests |
| 22 | + |
| 23 | +* Fill in the required template |
| 24 | +* Follow the [Swift API Design Guidelines](https://swift.org/documentation/api-design-guidelines/) |
| 25 | +* Include screenshots and animated GIFs in your pull request whenever possible |
| 26 | +* End all files with a newline |
| 27 | + |
| 28 | +### PR Title and Commit Convention |
| 29 | + |
| 30 | +PR titles should follow conventional commit standards. This helps automate the release process. |
| 31 | + |
| 32 | +The standard format for commit messages is as follows: |
| 33 | + |
| 34 | +``` |
| 35 | +<type>[optional scope]: <description> |
| 36 | +
|
| 37 | +[optional body] |
| 38 | +
|
| 39 | +[optional footer] |
| 40 | +``` |
| 41 | + |
| 42 | +The following lists the different types allowed in the commit message: |
| 43 | + |
| 44 | +- **feat**: A new feature (automatic minor release) |
| 45 | +- **fix**: A bug fix (automatic patch release) |
| 46 | +- **docs**: Documentation only changes |
| 47 | +- **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc) |
| 48 | +- **refactor**: A code change that neither fixes a bug nor adds a feature |
| 49 | +- **perf**: A code change that improves performance |
| 50 | +- **test**: Adding missing or correcting existing tests |
| 51 | +- **chore**: Changes that don't modify src or test files, such as automatic documentation generation, or building latest assets |
| 52 | +- **ci**: Changes to CI configuration files/scripts |
| 53 | +- **revert**: Revert commit |
| 54 | +- **build**: Changes that affect the build system or other dependencies |
| 55 | + |
| 56 | +### Testing |
| 57 | + |
| 58 | +We use XCTest framework for our testing. Please write tests for new code you create. Before submitting your PR, ensure all tests pass by running: |
| 59 | + |
| 60 | +#### Build and Test |
| 61 | +```bash |
| 62 | +xcodebuild -workspace mParticle-Apple-SDK.xcworkspace -scheme mParticle-Apple-SDK-iOS test |
| 63 | +``` |
| 64 | + |
| 65 | +#### SwiftLint |
| 66 | +```bash |
| 67 | +swiftlint |
| 68 | +``` |
| 69 | + |
| 70 | +Make sure all tests pass successfully before submitting your PR. If you encounter any test failures, investigate and fix the issues before proceeding. |
| 71 | + |
| 72 | +### Reporting Bugs |
| 73 | + |
| 74 | +This section guides you through submitting a bug report for the mParticle Apple SDK. Following these guidelines helps maintainers and the community understand your report, reproduce the behavior, and find related reports. |
| 75 | + |
| 76 | +To notify our team about an issue, please submit a ticket through our [mParticles support page](https://support.mparticle.com/hc/en-us/requests/new). |
| 77 | + |
| 78 | +**When you are creating a ticket, please include as many details as possible:** |
| 79 | + |
| 80 | +* Use a clear and descriptive title |
| 81 | +* Describe the exact steps which reproduce the problem |
| 82 | +* Provide specific examples to demonstrate the steps |
| 83 | +* Describe the behavior you observed after following the steps |
| 84 | +* Explain which behavior you expected to see instead and why |
| 85 | +* Include console output and stack traces if applicable |
| 86 | +* Include your SDK version and iOS/macOS version |
| 87 | + |
| 88 | +## License |
| 89 | + |
| 90 | +By contributing to the mParticle Apple SDK, you agree that your contributions will be licensed under its [Apache License 2.0](LICENSE). |
0 commit comments