> ## Documentation Index
> Fetch the complete documentation index at: https://tally.wharflab.com/llms.txt
> Use this file to discover all available pages before exploring further.

# tally/no-multi-spaces

> Disallows multiple consecutive spaces within Dockerfile instructions.

Disallows multiple consecutive spaces within Dockerfile instructions.

| Property | Value      |
| -------- | ---------- |
| Severity | Style      |
| Category | Style      |
| Default  | Enabled    |
| Auto-fix | Yes (safe) |

## Description

Multiple consecutive spaces within Dockerfile instructions are usually accidental and make the code harder to read. This rule flags any run of 2 or
more consecutive space characters within instruction lines.

The following are excluded:

* **Leading indentation**: whitespace before the instruction keyword
* **Heredoc body lines**: content between heredoc markers (semantically significant)
* **Comment lines**: lines starting with `#`

## Examples

### Bad

```dockerfile theme={null}
FROM  alpine:3.20
RUN  apk add  --no-cache  curl
COPY  . /app
```

### Good

```dockerfile theme={null}
FROM alpine:3.20
RUN apk add --no-cache curl
COPY . /app
```

## Auto-fix

This rule provides a safe auto-fix that replaces each run of multiple spaces with a single space:

```bash theme={null}
tally lint --fix Dockerfile
```

Each contiguous run of extra spaces is replaced independently, so a line with multiple occurrences receives one edit per run.

## Configuration

No custom configuration options. The rule is enabled by default with severity "style".

```toml theme={null}
# Disable the rule
[rules.tally.no-multi-spaces]
severity = "off"
```
