.. _sec-contributing-toolbox:

Toolbox
=======

Supporting the development of **xNVMe** is a toolbox with a collection of
scripts in Python, Bash and a ``Makefile`` to instrument it. See section
:ref:`sec-contributing-toolbox-mkhelper` for a description of it.

For common linter/format tooling then the `pre-commit`_ framework is used and
described in section :ref:`sec-contributing-toolbox-precommit`.

.. _sec-contributing-toolbox-mkhelper:

Makefile helper
---------------

As described in :ref:`sec-getting-started`,  **xNVMe** uses the `Meson`_
build-system, however, during development usage of the
:ref:`sec-contributing-toolbox` is invoked via ``make`` based on the
``Makefile`` in the root of the **xNVMe** repository.

The ``Makefile`` contains a bunch of helper-targets. Invoking ``make help``
provides a brief description of what is available:

.. literalinclude:: make.out
   :language: bash

.. _sec-contributing-toolbox-precommit:

Pre-commit / Git-hooks
----------------------

xNVMe utilizes the `pre-commit`_ framework for wrapping various code-format and
linters tools. You can enable it to run via `git-hooks`_ or invoke it manually
via the :ref:`sec-contributing-toolbox-mkhelper` e.g.::

  # format all files
  make format-all

  # format only files with staged changes
  make format

.. _Discord: https://discord.com/invite/XCbBX9DmKf
.. _Fork: https://github.com/OpenMPDK/xNVMe/fork
.. _GitHUB: https://github.com/OpenMPDK/xNVMe/issues
.. _discussions: https://github.com/OpenMPDK/xNVMe/discussions
.. _git-hooks: https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks
.. _issues: https://github.com/OpenMPDK/xNVMe/issues
.. _meson: https://mesonbuild.com/
.. _pre-commit: https://pre-commit.com/
.. _pull-request: https://github.com/OpenMPDK/xNVMe/pulls
.. _DCO: https://developercertificate.org/
