# Contributing

URL: https://select.dev/docs/resources/dbt-snowflake-monitoring/contributing
Index of all SELECT docs: https://select.dev/docs/llms.txt

> Contributing set-up guide

## Initial setup

1. Install pipx

```bash
pip install pipx
pipx ensurepath
```

2\. Install tox

```bash
pipx install tox
```

3\. Install pre-commit

```bash
pipx install pre-commit
pre-commit install
```

4\. Configure your profile (follow the prompts)

```bash
dbt init
```

## Adding a CHANGELOG Entry

We use changie to generate CHANGELOG entries. Note: Do not edit the CHANGELOG.md directly. Your modifications will be lost.

Follow the steps to [install changie](https://changie.dev/guide/installation/) for your system.

Once changie is installed and your PR is created, simply run `changie new` and changie will walk you through the process of creating a changelog entry. Commit the file that's created and your changelog entry is complete!

## SQLFluff

We use SQLFluff to keep SQL style consistent. By installing `pre-commit` per the initial setup guide above, SQLFluff will run automatically when you make a commit locally. A GitHub action automatically tests pull requests and adds annotations where there are failures.

Lint all models in the /models directory:

```bash
tox -e lint_all
```

Fix all models in the /models directory:

```bash
tox -e fix_all
```

Lint (or substitute lint to fix) a specific model:

```bash
tox -e lint -- models/path/to/model.sql
```

Lint (or substitute lint to fix) a specific directory:

```bash
tox -e lint -- models/path/to/directory
```

### Rules

Enforced rules are defined within `tox.ini`. To view the full list of available rules and their configuration, see the [SQLFluff documentation](https://docs.sqlfluff.com/en/stable/rules.html).
