Skip to content

Latest commit

 

History

History
70 lines (46 loc) · 3 KB

CONTRIBUTING.md

File metadata and controls

70 lines (46 loc) · 3 KB


Contributing

We welcome suggested improvements and bug fixes for sentry-cocoa, in the form of pull requests. Please follow our official Commit Guidelines and also prefix the title of your PR according to the 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

Run make init to get started. This will install bundler and Homebrew and their managed dependencies (see Gemfile and Brewfile).

Tests

The tests depend on our test server. To run the automated tests, you first need to have the server running locally with

make run-test-server

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.

All Objective-C, C and C++ needs to be formatted with Clang Format. The configuration can be found in .clang-format. Simply run the make task before submitting your changes for review:

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.