| 1 |
.. _resources_contributing: |
| 2 |
|
| 3 |
Contributing to WirePlumber |
| 4 |
=========================== |
| 5 |
|
| 6 |
Coding style |
| 7 |
------------ |
| 8 |
|
| 9 |
WirePlumber uses the `GNOME C Coding Style`_ with K&R brace placement |
| 10 |
and 2-space indentation, similar to `GStreamer's Coding Style`_. |
| 11 |
When in doubt, just follow the example of the existing code. |
| 12 |
|
| 13 |
WirePlumber ships with a `editorconfig <https://editorconfig.org/>`_ file. |
| 14 |
If your code editor / IDE supports this, it should automatically set up |
| 15 |
the indentation settings. |
| 16 |
|
| 17 |
.. important:: |
| 18 |
|
| 19 |
When submitting changes for review, please ensure that the coding style |
| 20 |
of the changes respects the coding style of the project. |
| 21 |
|
| 22 |
.. _GNOME C Coding Style: https://developer.gnome.org/programming-guidelines/unstable/c-coding-style.html.en |
| 23 |
.. _GStreamer's Coding Style: https://gstreamer.freedesktop.org/documentation/frequently-asked-questions/developing.html#what-is-the-coding-style-for-gstreamer-code |
| 24 |
|
| 25 |
Tests |
| 26 |
----- |
| 27 |
|
| 28 |
See :ref:`resources_testing` |
| 29 |
|
| 30 |
Running in gdb / valgrind / etc... |
| 31 |
---------------------------------- |
| 32 |
|
| 33 |
The Makefile included with WirePlumber supports the ``gdb`` and ``valgrind`` |
| 34 |
targets. So, instead of ``make run`` you can do ``make gdb`` or |
| 35 |
``make valgrind`` to do some debugging. |
| 36 |
|
| 37 |
You can also run in any other wrapper by setting the ``DBG`` variable |
| 38 |
on ``make run``. For example: |
| 39 |
|
| 40 |
.. code:: console |
| 41 |
|
| 42 |
$ make run DBG="strace" |
| 43 |
|
| 44 |
You may also use ``wp-uninstalled.sh`` directly as a wrapper to set up the |
| 45 |
environment and then execute any command. For example: |
| 46 |
|
| 47 |
.. code:: console |
| 48 |
|
| 49 |
$ ./wp-uninstalled.sh gdb --args wpctl status |
| 50 |
|
| 51 |
Merge requests |
| 52 |
-------------- |
| 53 |
|
| 54 |
In order to submit changes to the project, you should create a merge request. |
| 55 |
To do this, |
| 56 |
|
| 57 |
1. fork the project on https://gitlab.freedesktop.org/pipewire/wireplumber |
| 58 |
2. clone the forked project on your computer |
| 59 |
3. make changes in a new git branch |
| 60 |
4. rebase your changes on top of the latest ``master`` of the main repository |
| 61 |
5. push that branch on the forked repository |
| 62 |
6. follow the link shown by ``git push`` to create the merge request |
| 63 |
(or alternatively, visit your forked repository on gitlab and |
| 64 |
create it from there) |
| 65 |
|
| 66 |
.. important:: |
| 67 |
|
| 68 |
While creating the merge request, it is important to enable the |
| 69 |
**allow commits from members who can merge to the target branch** option |
| 70 |
so that maintainers are able to rebase your branch, since WirePlumber uses |
| 71 |
a fast-forward merge policy. |
| 72 |
|
| 73 |
For more detailed information, check out `gitlab's manual on merge requests`_ |
| 74 |
|
| 75 |
.. _gitlab's manual on merge requests: https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html |