# secrets/dotenv-linter

> Checks every tracked environment file: key format, duplicates, quoting, ordering, and trailing spaces.

Checks every tracked environment file: key format, duplicates, quoting, ordering, and trailing spaces.

Part of the [`secrets`](/reference/configurations/secrets/) configuration, at the `recommended` [level](/start/concepts/#levels). It runs at the `commit` [stage](/start/concepts/#stage), per file. It runs dotenv-linter. `gspot check --fix` fixes what it can.

## Why

Other people copy a tracked environment file, so a malformed line in it spreads to every machine.

## What to do

Run `gspot check --fix`, or fix the line dotenv-linter names.

## Example

A dotenv file that defines one key twice reports a duplicate. Keep one line, and delete the other.

## Turn it off

Turn it off for some files, or one of its lint rules, with a reason:

```shell
gspot ignore secrets/dotenv-linter --paths "<glob>" --reason "<why>"
gspot ignore secrets/dotenv-linter --rule <rule> --reason "<why>"
```
