From 03b0a35c0a34b573f796964af710ca7b45ecf5b9 Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Wed, 11 Mar 2026 10:08:47 +0100 Subject: [PATCH 1/3] add a hint on running CI before opening a PR --- CONTRIBUTING.md | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6f8577b7..2cbdf678 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -15,20 +15,24 @@ explained at https://help.github.com/articles/using-pull-requests You should fork the project into your own repo, create a topic branch -there and then make one or more pull requests back to the openstreetmap repository. -Your pull requests will then be reviewed and discussed. Please be aware -that you are responsible for your pull requests. You should be prepared -to get change requests because as the maintainers we have to make sure -that your contribution fits well with the rest of the code. Please make -sure that you have time to react to these comments and amend the code or -engage in a conversation. Do not expect that others will pick up your code, -it will almost never happen. +there and then make a single pull requests back to the main repository. +Your pull requests will then be reviewed and discussed. -Please open a separate pull request for each issue you want to address. -Don't mix multiple changes. In particular, don't mix style cleanups with -feature pull requests. If you plan to make larger changes, please open -an issue first or comment on the appropriate issue already existing so -that duplicate work can be avoided. +Please make sure to follow these guidelines: + +* Make sure CI passes _before_ opening the pull request. The repo is configured + to run the CI on branches. Once you have enabled the CI on your forked + repo, Actions will execute every time you push to your branch. Check + the Actions tab in your repo to make sure everything works. +* Make sure that you have time to react to these comments and amend the code or + engage in a conversation. Do not expect that others will pick up your code, + it will almost never happen. +* Open a separate pull request for each issue you want to address. + Don't mix multiple changes. In particular, don't mix style cleanups with + feature pull requests. +* For small fixes and amendmends open a PR directly. + If you plan to make larger changes, please open an issue first or comment + on the appropriate issue to outline your planned implementation. ### Using AI-assisted code generators From 55ae5f7bdc66a9f7df850e429bc2a36b5f59b10f Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Wed, 11 Mar 2026 10:17:25 +0100 Subject: [PATCH 2/3] updates on coding style and add permitted style changes --- CONTRIBUTING.md | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2cbdf678..7c35e8e5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -29,8 +29,8 @@ Please make sure to follow these guidelines: it will almost never happen. * Open a separate pull request for each issue you want to address. Don't mix multiple changes. In particular, don't mix style cleanups with - feature pull requests. -* For small fixes and amendmends open a PR directly. + feature pull requests (exceptions, see 'Style modernisation' below). +* For small fixes and amendments open a PR directly. If you plan to make larger changes, please open an issue first or comment on the appropriate issue to outline your planned implementation. @@ -58,27 +58,25 @@ Please see the development section of the Nominatim documentation for ## Coding style -Nominatim historically hasn't followed a particular coding style but we -are in process of consolidating the style. The following rules apply: - - * Python code uses the official Python style - * indentation - * SQL use 2 spaces - * all other file types use 4 spaces - * [BSD style](https://en.wikipedia.org/wiki/Indent_style#Allman_style) for braces - * spaces - * spaces before and after equal signs and operators - * no trailing spaces - * no spaces after opening and before closing bracket - * leave out space between a function name and bracket - but add one between control statement(if, while, etc.) and bracket - -The coding style is enforced with flake8. It can be tested with: +The coding style for Python is enforced with flake8. It can be tested with: ``` make lint ``` +SQL code is currently not linted but should follow the following rules: + +* 2 spaces indentation +* UPPER CASE for all SQL keywords + +### Style modernisation + +There are a few places where we modernize code style as we go. The following +changes can be made when you touch the code anyway: + +* update copyright date in the file header to the current year +* switch Python code to use [generics in standard collections](https://docs.python.org/3/whatsnew/3.9.html#type-hinting-generics-in-standard-collections) + ## Testing Before submitting a pull request make sure that the tests pass: From 821e5744b3cf902f18f68d0ce4f6de04a5c39e78 Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Wed, 11 Mar 2026 10:22:43 +0100 Subject: [PATCH 3/3] add links to forum and discussions to CONTRIBUTING --- CONTRIBUTING.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7c35e8e5..06d96069 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -7,6 +7,14 @@ Please always open a separate issue for each problem. In particular, do not add your bugs to closed issues. They may look similar to you but often are completely different from the maintainer's point of view. +If you just have a question or when you are not sure if what you have found +is an actual bug, use the [Discussion section](https://github.com/openstreetmap/Nominatim/discussions). + +If you have questions about the underlying OpenStreetMap data rather than +the geocoding software, then the +[OpenStreetMap forum](https://community.openstreetmap.org/) is the best +place to start. + ## Workflow for Pull Requests We love to get pull requests from you. We operate the "Fork & Pull" model