Thanks for your interest in contributing to Ol-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 ol-cesium as a developer.
Your contribution will be under our license as per GitHub's terms of service.
You will obviously start by forking the ol-cesium repository.
Make sure you clone the repositiory using git clone --recursive
command.
As an ol-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 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 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
object !== undefined
; - In the case of objects: use
the object itself
; - In all cases where the type is unknown, like with templates: use
object !== undefined && object !== null
.
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.