Thanks for your interest in contributing to Ol3-Cesium.
Our preferred means of receiving contributions is through pull requests. Make sure that your pull request follows our pull request guidelines below before submitting it.
This page describes what you need to know to contribute code to ol3-cesium as a developer.
Before accepting a contribution, we ask that you provide us a Contributor License Agreement. If you are making your contribution as part of work for your employer, please follow the guidelines on submitting a Corporate Contributor License Agreement. If you are making your contribution as an individual, you can submit a digital Individual Contributor License Agreement.
You will obviously start by forking the ol3-cesium repository.
Make sure you clone the repositiory using git clone --recursive
command.
As an ol3-cesium developer you will need to use the make
command in order
to run the linter, the compiler, the tests, etc.
The targets can be invoked using:
$ make <target>
where <target>
is the name of the target you want to execute. For example:
$ make dist
Your pull request should follow the OpenLayers 3 guidelines.
It is strongly recommended that you run
$ make check
before every commit. This will catch many problems quickly.
The check
build target runs a number of quick tests on your code. These
include:
- Lint
- Compile
- Tests
The OpenLayers 3's coding style should be followed except as specified below.
For readablitiy, testing for undefined
and null
must be handled as follows:
- In the case of numbers, strings and booleans: use
goog.isDef
; - In the case of objects: use
goog.isNull
orthe object itself
; - In all cases where the type is unknown, like with templates: use
goog.isDefAndNotNull
.
Please submit separate pull requests for separate issues. This allows each to be reviewed on its own merits.
The commit history explains to the reviewer the series of modifications to the code that you have made and breaks the overall contribution into a series of easily-understandable chunks. Any individual commit should not add more than one new class or one new function. Do not submit commits that change thousands of lines or that contain more than one distinct logical change. Trivial commits, e.g. to fix lint errors, should be merged into the commit that introduced the error. See the Atomic Commit Convention on Wikipedia for more detail.
git apply --patch
and git rebase
can help you create a clean commit
history.
Reviewboard.org
and Pro GIT have
explain how to use them.
Commit messages should be short, begin with a verb in the imperative, and contain no trailing punctuation. We follow http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html for the formatting of commit messages.
Git commit message should look like:
Header line: explaining the commit in one line
Body of commit message is a few lines of text, explaining things
in more detail, possibly giving some background about the issue
being fixed, etc etc.
The body of the commit message can be several paragraphs, and
please do proper word-wrap and keep columns shorter than about
74 characters or so. That way "git log" will show things
nicely even when it's indented.
Further paragraphs come after blank lines.
Please keep the header line short, no more than 50 characters.
Occasionally other changes to master
might mean that your pull request cannot
be merged automatically. In this case you may need to rebase your branch on a
more recent master
, resolve any conflicts, and git push --force
to update
your branch so that it can be merged automatically.