Skip to content

Latest commit

 

History

History
76 lines (52 loc) · 2.46 KB

CONTRIBUTING.md

File metadata and controls

76 lines (52 loc) · 2.46 KB

Contributing

Overview on how-to contribute

Dev branch: Last build

Fork the github repo, create a new branch from dev, and submit your pull request!

Make sure to run the tests before submitting the pull request (make test in the build directory, you may also run make docker_test for important contributions), and have a wee look at what follows.

Build Navitia

If you want to build navitia, please refer to the installation documentation.

You can also check the automated build script which is meant to be a step by step tutorial for compiling and using navitia with ubuntu 16.04.

Code Organisation

At the root of the repository, several directories can be found:

  1. source: contains the navitia source code (c++ and python)
  2. third_party: third party developped modules
  3. documentation: all the navitia documentation
  4. (debug|release): by convention, the build repositories

Tools

  • Gcc (or clang) as the C++ compiler (g++)
  • CMake for the build system
  • Python for the api

Git hooks

The project provides a few git hooks that you should use to prevent any issue. The hooks are managed by pre-commit that you need to install. Then, install the hooks with:

pre-commit install

Python formatting

Python source code in this project is formatted using Black You should enable the pre-commit git hook to make sure it's being run before commiting your changes, it's also the easiest way to run Black.
Otherwise, to only update the files that you've changed, simply run:

pre-commit run black

If you want to run it on the whole project, you can add --all:

pre-commit run black --all

You can also install Black traditionally But bare in mind, it requires python 3.6+ to run.

C++ formatting

Our pre-commit hooks are running Clang-format to format our c++ codebase. You'll need version 6.0 in order to pass our CI.

sudo apt install clang-format-6.0

In case you might want to run Clang-format on the entire codebase, you can do:

pre-commit run clang-format-6.0 --all