# Lint

Paradime provides built-in code quality tools to help maintain consistent formatting and style in your dbt™ project. The Lint feature automatically applies the appropriate formatting tool based on your file type.

### How It Works

Click the **Lint** button in the Command Panel while editing a file to automatically format your code. The tool used for formatting is determined by the file type you have open in the editor:

* [**SQLfluff**](#sqlfluff) - runs to lint your SQL code if you're editing a `.sql` file.
* [**Prettier**](#prettier) - runs to lint your YAML if you're editing a `.yml` file.

<figure><img src="https://2337193041-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHET0AD04uHMgdeLAjptq%2Fuploads%2FLxJ70T5d3y4ASCUFFK2w%2Fimage.png?alt=media&#x26;token=53336423-243e-4869-82a4-1538455659de" alt=""><figcaption></figcaption></figure>

***

### SQLFluff

SQLfluff is a SQL linter that helps maintain consistent SQL code style and catch potential errors. It understands dbt™ and Jinja templating, making it perfect for dbt™ projects.

#### Configuring .sqlfluff

Before using SQLfluff, create a configuration file to customize its behavior:

1. Create a `.sqlfluff` file in your dbt™ project root directory (same location as your `dbt_project.yml`)
2. Add your configuration:

{% code title=".sqlfluff example file" %}

```yaml
[sqlfluff]
dialect = snowflake  # Update based on your warehouse
templater = dbt

[sqlfluff:templater:dbt]
project_dir = ./

# Common rules to exclude
exclude_rules = ambiguous.column_count, structure.column_order

# Line length limit
max_line_length = 120
```

{% endcode %}

{% hint style="info" %}
Visit [SQLfluff documentation](https://docs.sqlfluff.com/en/stable/configuration.html) for a complete list of configuration options.
{% endhint %}

#### Using SQLfluff

1. Open a `.sql` file in your editor
2. Click the **Lint** button in the [Command Panel](https://docs.paradime.io/app-help/documentation/code-ide/command-panel)
3. Review the changes made in [Git Lite](https://docs.paradime.io/app-help/documentation/code-ide/left-panel/git-lite)
   * Syntax errors
   * Style violations
   * Formatting suggestions
4. If satisfied with Lint updates, [Commit and Push](https://docs.paradime.io/app-help/documentation/left-panel/git-lite#commit-and-push-your-changes) your changes to your remote branch.&#x20;

{% @arcade/embed flowId="M3tkMiQ8rJHKsjustE4s" url="<https://app.arcade.software/share/M3tkMiQ8rJHKsjustE4s>" %}

{% hint style="info" %}
Want to automate SQLfluff linting? Learn how to set up [SQLfluff pre-commit hooks](https://docs.paradime.io/app-help/documentation/integrations/code-ide/pre-commit/sqlfluff-hooks) to automatically lint SQL files before each commit.
{% endhint %}

***

### Prettier

Prettier automatically formats your YAML files to ensure consistent structure across your dbt™ project. While the integration works out of the box, you can customize Prettier's behavior:

#### Configuring Prettier

While Prettier works out of the box with sensible defaults, you can customize its behavior:

1. Create a `.prettierrc.yaml` file in your dbt™ project root directory (same location as your `dbt_project.yml`)
2. Add your configuration:

<pre class="language-yaml" data-title=".prettierrc.yaml example file"><code class="lang-yaml"># .prettierrc.yaml example file
<strong>yamlCopyparser: yaml
</strong>trailingComma: es5
tabWidth: 4
semi: false
singleQuote: true
printWidth: 100
</code></pre>

{% hint style="info" %}
Visit [prettier documentation](https://prettier.io/docs/en/configuration.html) a complete list of configuration options.
{% endhint %}

#### Using Prettier

1. Open a `.yml` file in your editor
2. Click the **Lint** button in the [Command Panel](https://docs.paradime.io/app-help/documentation/code-ide/command-panel)
3. Review the changes in [Git Lite](https://docs.paradime.io/app-help/documentation/code-ide/left-panel/git-lite)
   * YAML syntax corrections
   * Formatting improvements
   * Structure updates
4. If satisfied with Lint updates, [Commit and Push](https://docs.paradime.io/app-help/documentation/left-panel/git-lite#commit-and-push-your-changes) your changes to your remote branch

{% @arcade/embed flowId="mhDEXtnZo6K5nV53VADe" url="<https://app.arcade.software/share/mhDEXtnZo6K5nV53VADe>" %}

{% hint style="info" %}
Want to automate YAML formatting? Learn how to set up [Prettier pre-commit hooks](https://docs.paradime.io/app-help/documentation/integrations/code-ide/pre-commit/prettier-hooks) to automatically format YAML files before each commit.
{% endhint %}
