# bash/shfmt

> Checks that every shell script matches the shfmt output.

Checks that every shell script matches the shfmt output.

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

## Why

One formatter means diffs show what changed, not how someone’s editor indents.

## What to do

Run `gspot check --fix` to format every script, or `shfmt -w` on one file.

## Example

`if true;then echo hello;fi` differs from the shfmt output. Run `gspot check --fix` to add the spacing and line breaks.

## Turn it off

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

```shell
gspot ignore bash/shfmt --paths "<glob>" --reason "<why>"
gspot ignore bash/shfmt --rule <rule> --reason "<why>"
```
