Skip to content

Latest commit

 

History

History
85 lines (57 loc) · 3.03 KB

CONTRIBUTING.md

File metadata and controls

85 lines (57 loc) · 3.03 KB


Contributing

We welcome suggested improvements and bug fixes for sentry-cocoa, in the form of pull requests on GitHub. Please follow our official Commit Guidelines. The guide below will help you get started, but if you have further questions, please feel free to reach out on Discord.

Setting up an Environment

You need to install bundler and all dependencies locally to run tests:

gem install bundler
bundle install

All Objective-C, C and C++ needs to be formatted with Clang Format. The configuration can be found in .clang-format. To install Clang Format:

npm install -g clang-format
# OR
brew install clang-format
# OR
apt-get install clang-format

Install SwiftLint for linting and formatting Swift code.

With that, the repo is fully set up and you are ready to run all commands.

Tests

Test guidelines:

  • We write our tests in Swift. When touching a test file written in Objective-C consider converting it to Swift and then add your tests.
  • Make use of the fixture pattern for test setup code. For examples, checkout SentryClientTest or SentryHttpTransportTests.
  • Use TestData when possible to avoid setting up data classes with test values.

Test can either be ran inside from Xcode or via

make test

Code Formatting

Please follow the convention of removing the copyright code comments at the top of files. We only keep them inside SentryCrash, as the code is based on KSCrash.

Only PRs with properly formatted code are acccepted. To format all code run:

make format

Linting

We use Swiftlint and Clang-Format. For Swiftlint we keep a seperate config file for the tests. To run all the linters locally execute:

make lint

Environment

Please use Sentry.xcworkspace as the entry point when opening the project in Xcode. It also contains all samples for different environments.

Public Headers

To make a header public follow these steps:

Final Notes

When contributing to the codebase, please make note of the following:

  • Non-trivial PRs will not be accepted without tests (see above).
  • Please do not bump version numbers yourself.