Contributing

Workflow

We use pre-commit for code formatting, and some linter checks. You can install it by

$ pre-commit install -t pre-commit -t commit-msg

We use commitizen to auto generate the CHANGELOG.md. You don’t need to install it or know anything about the tool itself, but please follow the conventional commits rule when writing commit messages.

Install Virtual Environment

We recommend using virtual environment for development. You can create one by

$ python -m venv .venv
$ source .venv/bin/activate

Install Dependencies

We recommend to install the local subpackages in editable mode.

$ pip install -r requirements.txt
$ bash foreach.sh install-editable

Running Tests

By default, all tests under all plugins would be run.

$ # export DONT_SKIP_JTAG_TESTS=1 (when you have a jtag connection)
$ pytest

Writing Tests

Basically we’re following the official documentation. You could also refer to the tests under each plugin.

Building Docs

We use sphinx with espressif theme to build the docs. The docstring is written in Google style. Here’s an example.

For building locally, you need to install the dependencies first.

$ pip install -r docs/requirements.txt

Then you can build the docs by

$ cd docs
$ make html

For documentation preview, you may use any browser you prefer. The executable has to be searchable in PATH. For example we’re using firefox here.

$ firefox _build/html/index.html