This is a guide to help you get started contributing to the DataStax C/C++ Driver.
Fork the driver on GitHub and clone your fork locally.
$ git clone https://github.com/username/cassandra-cpp-driver.git $ cd cassandra-cpp-driver $ git remote add upstream https://github.com/apache/cassandra-cpp-driver
Features that require breaking API or ABI changes should be reserved for major releases and will probably not be considered for minor or patch releases. For features and big changes consider using a feature branch.
$ git checkout -b awesome-new-feature
Make sure to git rebase to keep your branch up-to-date.
$ git fetch upstream
$ git rebase upstream
To avoid duplication of work it's important to check JIRA to see if a bug or feature has already been fixed or added. JIRA should also be used to report issues and to track new features.
As a rule of thumb, follow the style of the current code. In general, the code follows the conventions and style defined in the Google C++ Style Guide. Differences and other key points are outlined below.
cass_ or CASS_.cassandra.h should conform to C89 syntax.SomeClass.do_something_with_object._ characterif, while, switch etc. keywords should have a space between it and the opening parenthesis.if (some_condition) { // Do something } else if (some_other_condition) { // Do something else } while (some_condition) { // Do something }
SomeObject() : member1_(1) , member2_(0.0f) // ... , memberN_("foo") {}
// This is comment
Tests should be included for both bug fixes and features. Tests should be added to test/unit_tests/src or tests/integration_tests/src. Unit tests should be used for testing components or changes that don't require Cassandra.
This testing guide is useful for understanding the structure of the tests and how to run them.
Make sure that your commit has a proper commit message with a succinct, and descriptive first line followed by a blank line. The message should also contain a description of the change and why it was required.
Once your changes look good and you've crafted a proper commit message push your branch and create a pull request.
$ git push origin awesome-new-feature
Go to your fork (https://github.com/username/cassandra-cpp-driver), select the branch with your changes and click ‘Pull Request’. Fill out the pull request and submit.
Your changes should usually be reviewed within a few days, otherwise we'll try to give you a timeline. If your pull request requires fixes or changes please submit them in a new commit. These commits will be squashed before your pull request is merged.