mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-18 14:45:12 +02:00
Contributing
This commit is contained in:
@@ -0,0 +1,77 @@
|
||||
# Contributing to iD
|
||||
|
||||
Thinking of contributing to iD? High five! Here are some basics for our habits
|
||||
so that you can write code that fits in perfectly.
|
||||
|
||||
## Javascript
|
||||
|
||||
We use the [Airbnb style for Javascript](https://github.com/airbnb/javascript) with
|
||||
only one difference:
|
||||
|
||||
**4 space soft tabs always for Javascript, not 2.**
|
||||
|
||||
No aligned `=`, no aligned arguments, spaces are either indents or the 1
|
||||
space between expressions. No hard tabs, ever.
|
||||
|
||||
Javascript code should pass through [JSHint](http://www.jshint.com/) with no
|
||||
warnings.
|
||||
|
||||
## HTML
|
||||
|
||||
There isn't much HTML in iD, but what there is is similar to JS: 4 spaces
|
||||
always, indented by the level of the tree:
|
||||
|
||||
```html
|
||||
<div>
|
||||
<div></div>
|
||||
</div>
|
||||
```
|
||||
|
||||
## CSS
|
||||
|
||||
Just like HTML and Javascript, 4 space soft tabs always.
|
||||
|
||||
```css
|
||||
.radial-menu-tooltip {
|
||||
background: rgba(255, 255, 255, 0.8);
|
||||
}
|
||||
```
|
||||
|
||||
We write vanilla CSS with no preprocessing step. Since iD targets modern browsers,
|
||||
feel free to use newer features wisely.
|
||||
|
||||
## Tests
|
||||
|
||||
Test your code and make sure it passes. Our testing harness requires [node.js](http://nodejs.org/)
|
||||
and a few modules:
|
||||
|
||||
1. [Install node.js](http://nodejs.org/) - 'Install' will download a package for your OS
|
||||
2. Go to the directory where you have checked out `iD`
|
||||
3. Run `npm install`
|
||||
4. Run `npm test` to see whether your tests pass or fail.
|
||||
|
||||
## Licensing
|
||||
|
||||
iD is under the [WTFPL](http://www.wtfpl.net/). Some of the libraries it uses
|
||||
are under different licenses. If you're contributing to iD, you're contributing
|
||||
WTFPL code.
|
||||
|
||||
## Submitting Changes
|
||||
|
||||
Let's say that you've thought of a great improvement to iD - a change that
|
||||
turns everything red (please do not do this, we like colors other than red).
|
||||
|
||||
In your local copy, make a branch for this change:
|
||||
|
||||
git checkout -b make-red
|
||||
|
||||
Make your changes to source files. By source files we mean the files in `js/`.
|
||||
the `iD.js` and `iD.min.js` files in this project are autogenerated - don't edit
|
||||
them.
|
||||
|
||||
So let's say you've changed `js/ui/confirm.js`.
|
||||
|
||||
1. Run `jshint src` to make sure your code is clean
|
||||
2. Run tests with `npm test`
|
||||
3. Commit your changes with an informative commit message
|
||||
4. [Submit a pull request](https://help.github.com/articles/using-pull-requests) to the `systemed/iD` project.
|
||||
@@ -16,8 +16,7 @@
|
||||
|
||||
## Participate!
|
||||
|
||||
* [Read NOTES.md, our ongoing dev journal](https://github.com/systemed/iD/blob/master/NOTES.md)
|
||||
* Fork this project. We eagerly accept pull requests.
|
||||
* [Read up on Contributing and the code style of iD](CONTRIBUTING.md)
|
||||
* See [open issues in the issue tracker if you're looking for something to do](https://github.com/systemed/iD/issues?state=open)
|
||||
|
||||
To run the code locally, just fork this project and run it from a local webserver.
|
||||
|
||||
Reference in New Issue
Block a user