Glad to hear you'd like to help us improving the library. Here's the how-to!
Sounds nice! Please proceed as following:
- Search for existing issues. Sometimes, other folks may have reported the same issue and it'd be nice not to duplicate them.
- If possible, please create an isolated and reproducible test case. Make use of jsFiddle - for instance - to share your isolated test cases. We won't hold it against you for feature requests, but a live [POC][] is sometimes easier to catch. [POC]: http://en.wikipedia.org/wiki/Proof_of_concept
- Share as much information as possible. Include browser and version, version of gitgraph.js, etc. where appropriate. That can help us to reproduce the bug, if so.
Github's Pull Request is a fantastic tool to contribute to the code.
Just keep in mind the following rules:
- Change must be done in
src/
files, eventuallytest/
orexamples/
, that's all. - You'd be nice not to pollute your pull request with unintended changes.
- Pull requests should always be against the
develop
branch, never againstmaster
norgh-pages
.
Once you send a Pull Request, your code will be checked with [Travis CI][] to tell whether you break the build or not. The Travis test should pass before we accept any Pull Request. [Travis CI]: https://travis-ci.org/nicoespeon/gitgraph.js
Please follow our coding standards as best as you can to keep consistency over code.
The [.editorconfig][] file should help you configure your IDE to do so. [.editorconfig]: https://github.com/nicoespeon/gitgraph.js/blob/develop/.editorconfig
- 2 spaces indent (no tabs)
- Use semicolons
- Use strict mode
- Strings must use double-quote
- Adhere to the (default) CSScomb property order
- Multiple-line approach (one property and value per line)
- Always a space after a property's colon (.e.g,
display: block;
and notdisplay:block;
) - End all lines with a semi-colon
- For multiple, comma-separated selectors, place each selector on its own line
- Attribute selectors, like
input[type="text"]
, should always wrap the attribute's value in double quotes, for consistency and safety (see [this blog post on unquoted attribute values][blog] that can lead to XSS attacks). [blog]: http://mathiasbynens.be/notes/unquoted-attribute-values
- Two spaces for indentation, never tabs
- Double quotes only, never single quotes
- Always use proper indentation
- Use tags and elements valid for an HTML5 doctype
By contributing your code, you agree to license your contribution under the terms of the [MIT license][] [MIT license]: https://github.com/nicoespeon/gitgraph.js/blob/master/LICENSE.md