]> git.openstreetmap.org Git - nominatim.git/blob - CONTRIBUTING.md
adapt coding style for new spaces-only policy
[nominatim.git] / CONTRIBUTING.md
1 # Nominatim contribution guidelines
2
3 ## Workflow
4
5 We operate the "Fork & Pull" model explained at
6
7 https://help.github.com/articles/using-pull-requests
8
9 You should fork the project into your own repo, create a topic branch
10 there and then make one or more pull requests back to the openstreetmap repository.
11 Your pull requests will then be reviewed and discussed.
12
13 ## Coding style
14
15 Nominatim historically hasn't followed a particular coding style but we
16 are in process of consolodating the style. The following rules apply:
17
18  * Python code uses the official Python style
19  * indention
20    * SQL use 2 spaces
21    * all other file types use 4 spaces
22    * [BSD style](https://en.wikipedia.org/wiki/Indent_style#Allman_style) for braces
23  * spaces
24    * spaces before and after equal signs and operators
25    * no trailing spaces
26    * no spaces after opening and before closing bracket
27    * leave out space between a function name and bracket
28      but add one between control statement(if, while, etc.) and bracket
29
30 This coding style must be applied to any new or changed code. You are also
31 welcome to fix the coding style of existing code but please submit separate
32 PRs for this.
33
34 ## Testing
35
36 Before submitting a pull request make sure that the following tests pass:
37
38 ```
39   cd tests
40   NOMINATIM_DIR=<builddir> lettuce -t -Fail -t -Tiger features/db features/osm2pgsql
41 ```
42
43 ```
44   cd test-php
45   phpunit ./
46 ```