Contributing to Confit
We welcome contributions ! There are many ways to help. For example, you can:
- Help us track bugs by filing issues
- Suggest and help prioritise new functionalities
- Help us make the library as straightforward as possible, by simply asking questions on whatever does not seem clear to you.
Development installation
To be able to run the test suite and develop your own pipeline, you should clone the repo and install it locally. You will need to have uv installed.
# Clone the repository and change directory
git clone ssh://git@github.com/aphp/confit.git
cd confit
# Install the library with its dev dependencies
uv pip install -e . --group dev --group docs
# Activate the virtual environment
source .venv/bin/activate
To make sure the pipeline will not fail because of formatting errors, we added pre-commit hooks using the pre-commit Python library. To use it, simply install it:
pre-commit install
The pre-commit hooks defined in the configuration will automatically run when you commit your changes, letting you know if something went wrong.
The hooks only run on staged changes. To force-run it on all files, run:
uv run pre-commit run --all-files
Proposing a merge request
Ideally, your changes should :
- Be well-documented
- Pass every tests, and preferably implement their own
- Follow the style guide.
Testing your code
We use the Pytest test suite.
The following command will run the test suite. Writing your own tests is encouraged !
uv run pytest
Should your contribution propose a bug fix, we require the bug be thoroughly tested.
Style Guide
We use Ruff to reformat the code.
Moreover, the CI/CD pipeline enforces a number of checks on the "quality" of the code. To wit, non ruff-formatted code will make the test pipeline fail. We use pre-commit to keep our codebase clean.
Refer to the development install tutorial for tips on how to format your files automatically. Most modern editors propose extensions that will format files on save.
Documentation
Make sure to document your improvements, both within the code with comprehensive docstrings, as well as in the documentation itself if need be.
We use MkDocs for Confit's documentation. You can checkout the changes you make with:
uv run mkdocs serve
Go to localhost:8000 to see your changes. MkDocs watches for changes in the documentation folder and automatically reloads the page.