Skip to content

Commit

Permalink
Added contributing.md
Browse files Browse the repository at this point in the history
  • Loading branch information
wpfl-dbt committed Jan 7, 2025
1 parent 8e7a9d8 commit 47057e3
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 0 deletions.
72 changes: 72 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Developer's guide

This document describes how you can get started with developing Matchbox.

## Dependencies

* [Python 3.11+](https://www.python.org)
* [uv](https://docs.astral.sh/uv/)
* [Docker](https://www.docker.com)
* [TruffleHog](https://github.com/trufflesecurity/trufflehog)
* [PostgreSQL](https://www.postgresql.org)
* [pre-commit](https://pre-commit.com)
* [just](https://just.systems/man/en/)

## Setup

Set up environment variables by creating a `.env` file under project directory. See [/environments/dev_local.env](./environments/dev_local.env) for sensible defaults.

This project is managed by [uv](https://docs.astral.sh/uv/), linted and formated with [ruff](https://docs.astral.sh/ruff/), and tested with [pytest](https://docs.pytest.org/en/stable/). [Docker](https://www.docker.com) is used for local development.

To install all dependencies for this project, run:

```cnosole
uv sync --all-extras
```

Secret scanning is done with [TruffleHog](https://github.com/trufflesecurity/trufflehog).

For security, use of [pre-commit](https://pre-commit.com) is expected. Ensure your hooks are installed with `pre-commit install`.

Task running is done with [just](https://just.systems/man/en/). To see all available commands:

```console
just -l
```

## Run tests

A just task is provided to run all tests.

```console
just test
```

If you're running tests with some other method, such as your IDE or pytest directly, you'll need to start the local backends and mock warehouse in Docker.

```console
docker compose up -d --wait
```

## Standards

### Code

When contributing to the main matchbox repository and its associated repos, we try to follow consistent standards. Python code should be:

* Unit tested, and pass new and existing tests
* Documented via docstrings, in the [Google style](https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html)
* Linted and auto-formatted (`just format`)
* Type hinted (within reason)
* Using env files and dotenv for setting environment variables
* Structured as a Python package with `pyprojects.toml`
* Using dependencies managed automatically by uv
* Integrated with justfile when relevant
* Documented, for example, `README.md` files where relevant

### Git

We commit as frequently as possible. We keep our commits as atomic as possible. We never push straight to main, instead we merge feature branches. Before merging to main, branches are peer reviewed.

> [!CAUTION]
> pre-commit **must** be turned on. Any secrets you commit to the repo are your own responsibility.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ With the truth threshold set to `1.0` by default, deterministic methodologies ar

## Development

See our full development guide and coding standards in [CONTRIBUTING.md](./CONTRIBUTING.md)

This project is managed by [uv](https://docs.astral.sh/uv/), linted and formated with [ruff](https://docs.astral.sh/ruff/), and tested with [pytest](https://docs.pytest.org/en/stable/). To install all dependencies for this project, run:

```
Expand Down

0 comments on commit 47057e3

Please sign in to comment.