---
title: "format/comments/header"
pagination: false
---

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

<RuleId id="format/comments/header" />

Not in any preset. Safe fix.

## What it does

Add, replace or remove header comment.

## Configuration

```toml title="pun.toml"
[format.rules]
"comments/header" = true
```

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

## Options

| Name | Type | Allowed values | Default | Upstream name |
| --- | --- | --- | --- | --- |
| `comment-type` | `enum` | `phpdoc`, `comment` | `"comment"` | `comment_type` |
| `header` | `string` | Any | Not set | `header` |
| `location` | `enum` | `after-open`, `after-declare-strict` | `"after-declare-strict"` | `location` |
| `separate` | `enum` | `both`, `top`, `bottom`, `none` | `"both"` | `separate` |
| `validator` | `string` | Any | Not set | `validator` |

## Replaces

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

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