Skip to content

Contributor's guide

dbt-score is free software, your contributions are welcome! 🚀

Reporting bugs

If you encountered a bug, check the issue tracker on Github to see if it is already known. If not, feel free to open a new issue. Share all relevant details, especially how to reproduce the problem.

We'd love to hear from you and help make dbt-score as stable as we can.

Developing new features

Adding rules

The linting rules bundled with dbt-score aim to be as generic as possible, and apply to a large majority of dbt projects.

This is why they are not very opinionated: for example, we believe documenting data models is important, and hope it's not a controversial opinion ;) Of course, it's always possible to disable any rule.

If you think a new rule should be created in dbt-score, feel free to open an issue to discuss it first - this might save you some work in case maintainers don't see a fit.

If your rule idea is not generic and applies to your own project and logic, dbt-score has been designed to fully support custom rules. Create as many as you need for your purposes!

Fixing bugs

We love bug squashing! You can open a pull request to fix any bug you encounter in dbt-score. If the changes are large enough, refer to the next section first - discussing a solution in a Github issue is always a good idea to avoid unnecessary work and orchestrate efforts.

Adding or changing core features

Before implementing or changing a new feature, we kindly ask you to open a Github issue to get the maintainers' opinion on that feature. It might have been already considered, discussed, or already in the works.

We aim to maintain a high code coverage in dbt-score's unit tests, so new features should be properly tested for happy and unhappy paths.

If the feature has direct impact on users, it should also be reflected in the documentation website.

Development environment

Prerequisites

You'll need the following:

  • Any Python version starting from 3.10
  • pre-commit (recommended)
  • PDM

After cloning the repository with git, configure your development environment by running these commands from the project's root:

pre-commit install
pdm install --group :all

The pdm command will install all project's dependency groups, including all the dependencies needed for development purposes.

Lint

dbt-score uses:

Cheatsheet:

pdm run ruff check .
pdm run ruff check --fix
pdm run mypy .
pdm run tox -e lint

Test

dbt-score uses:

  • pytest as a main test framework.
  • coverage for test coverage.
  • tox for testing against multiple Python versions.

Cheatsheet:

pdm run tox -e py
pdm run pytest
pdm run coverage run -m pytest

Docs

dbt-score uses:

Cheatsheet:

pdm run mkdocs build
pdm run mkdocs serve

Pre-commit

Cheatsheet:

Execute hooks manually:

pre-commit run --all-files

Create a commit bypassing hooks:

git commit --no-verify