---
title: "format/operators/not-with-space"
pagination: false
---

{/* Generated by scripts/gen-rule-docs.py. Edit mapping.toml, not this file. */}

<RuleId id="format/operators/not-with-space" />

Not in any preset. Safe fix.

## What it does

Logical NOT operators (`!`) should have leading and trailing whitespaces.

## Configuration

```toml title="pun.toml"
[format.rules]
"operators/not-with-space" = true
```

To skip it in some files, add a [`@pun-ignore-file`](/docs/configuration/ignore-comments) comment.

## Replaces

- [`not_operator_with_space`](https://cs.symfony.com/doc/rules/operator/not_operator_with_space.html) (php-cs-fixer)

[More format/operators rules](/docs/rules/format/operators) · [Edit this page](https://github.com/shipfastlabs/pun/edit/main/crates/pun-config/rules/mapping.toml)
