]> git.openstreetmap.org Git - nominatim.git/blob - CONTRIBUTING.md
Merge pull request #659 from lonvia/full-indexing-in-tests
[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 The coding style is enforced with PHPCS and can be tested with:
31
32 ```
33   phpcs --report-width=120 --colors */**.php
34 ```
35
36 ## Testing
37
38 Before submitting a pull request make sure that the following tests pass:
39
40 ```
41   cd test/bdd
42   behave -DBUILDDIR=<builddir> db osm2pgsql
43 ```
44
45 ```
46   cd test/php
47   phpunit ./
48 ```