Skip to content

release: v2.2.3 - text inside an existing header that isn't a header… - #145

Merged
cldmv-bot[bot] merged 14 commits into
masterfrom
next
Oct 31, 2026
Merged

cldmv-bot[bot] merged 14 commits into
masterfrom
next

Conversation

@cldmv-bot

@cldmv-bot cldmv-bot Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

@cldmv/fix-headers v2.2.3 Changelog

Release Date: October 2026
Release Type: Patch
Branch: release/2.2.3


Overview

Version 2.2.3 fixes data loss in a header rewrite. Until now, rewriting an existing header replaced the whole matched comment, so any text in it that was not a header field (a description under @Copyright, a co-author or licence line, a line wrapping a field's value) was deleted. A repository-wide run over 756 files removed about 68 such lines from 8 files (#160). That text is now always kept, verbatim and in its original order.

By default the kept text moves out of the header into its own comment block directly below it, so the header block holds only header fields. Because there are two reasonable places for that text, the fix comes with a strictHeaderBlock setting to choose between them: turning it off (CLI --no-strict-header-block, or --strict-header-block false) keeps the text inside the header after the fields instead. Either way it is never deleted.

This changes what a run writes to files whose header carries extra text: the first run after upgrading moves that text below the header. Files whose header holds only fields are written exactly as before. The rest of the release is a dependency refresh, including ignore 7.0.14 within its existing range.


🐛 Bug Fixes

Text inside an existing header is kept, never deleted (#161, fixes #160)

Any line in an existing header that is not one of the fields fix-headers writes (@Project, @Filename, @Date, @Author, @Email, @Last modified by, @Last modified time, @Copyright), a ----- separator or an empty comment line is now header text, and header text is never dropped. In detail:

  • Text moves to its own block. With strictHeaderBlock (the default), header text is written, comment prefix included, to a comment block directly below the regenerated header, in the file's comment style (/** … */, <!-- … --> or # lines) and with the file's own line ending. The configured margin separates the header, the moved block and the rest of the file.
  • Or stays in the header. With strictHeaderBlock off ("strictHeaderBlock": false in the config file, --no-strict-header-block or --strict-header-block false on the CLI) the text stays inside the header after an empty comment line below the fields. The setting is in the fixHeaders options type and the --help text.
  • Only the first tag is a field. A repeated @Author or @Copyright line (a third-party notice, for example) is kept as text instead of being merged into the field. A dash line among text, rather than next to a field, is text too.
  • Wrapped values are kept. A line that continues a field's value used to be removed when the field was rewritten. Because fix-headers did not write it, it is now kept as text.
  • Directives stay above a # header. Directive lines at the top of a # comment stay where they are: a PEP 263 encoding declaration (# -*- coding: utf-8 -*-) on the file's first or second line, #cloud-config, a yaml-language-server comment, and vim:/vi:/ex: modelines at the start of the comment text. Any other comment line there, including prose such as "Decoding: base64", is header text.
  • A second run leaves the moved block alone. A comment after the header is only absorbed as a stacked copy of the header when its first non-empty line is @Project:. A moved block whose first line is itself a @Project: line is written with the lead line Moved out of the file header by fix-headers: above it, so a later run does not read it back as fields.
  • The edit is not a content change. Moving text out of the header keeps the recorded @Last modified by.
  • --diff and --sample-output show the move. The new value covers the header and the block moved below it, so moved text appears as moved rather than deleted.
  • HTML header delimiters. The closing delimiter of an HTML-comment header is stripped whether it is written --> or --!>.

Follow-up edge cases found while reviewing this fix are tracked in #162. They cover # headers in files with CRLF line endings or a byte-order mark, a stacked header that starts with text, and vi: prose at the very top of a comment.

📚 Documentation

  • NEW: docs/changelog/v2/v2.2.3.md: this changelog.
  • README: new "Text in the header block" section with a before/after example, and the strictHeaderBlock option and CLI flags in the option lists (#161).
  • README What's New promoted to v2.2.3.

🔧 Dependencies

Every entry is a lockfile-only update within the existing package.json range; no range changed.

Runtime

  • ignore 7.0.12 → 7.0.14 (#163). It is the only dependency fix-headers declares (^7.0.5) and is kept external by the build, so a consumer's install already resolves it from that range.

Development

  • prettier 3.9.9 → 3.9.10 (#144).
  • vitest and @vitest/coverage-v8 5.0.3 → 5.0.5, with vite 8.3.2 → 8.3.5, rolldown 1.2.12 → 1.2.16 and its platform bindings (#163).
  • @cldmv/vitest-runner 1.5.3 → 1.5.6 (#163).
  • @cldmv/configs 1.2.4 → 1.3.0, the shared config behind this repository's own fix:headers run. That run leaves every file unchanged with the new version (#163).
  • eslint 10.12.0 → 10.14.0, @eslint/css 2.0.1, @eslint/json 2.1.1 (#163).
  • @cldmv/jsonv 1.1.5, @cldmv/eslint-plugin-jsonv 1.0.17, @cldmv/prettier-plugin-jsonv 1.1.4 (#163).
  • @types/node 26.6.4 → 26.6.6 (#163).
  • Development-only transitives, including postcss 8.5.32, nanoid 3.3.20 and source-map-js 1.2.2. These also cover the Dependabot security bumps that had been opened against hotfixes (#163).

Upgrade notes

  • No breaking change to the fixHeaders API or the CLI. strictHeaderBlock defaults to on, so existing configs need no change.
  • Expect a one-time diff in files whose header carries extra text. The first run after upgrading moves that text into its own block below the header. Run with --dry-run --diff first to review it, or set "strictHeaderBlock": false to keep the text inside the header.
  • Text that an earlier version already deleted is not recovered; restore it from version control if needed.
👥 Contributors

coverage

Metric Coverage
Statements 99.9%
Branches 98.2%
Functions 100.0%
Lines 99.9%

Avg: 99.5% · 8ffd077 · Node lts/*

Co-authored-by: Shinrai [email protected]

dependabot Bot and others added 3 commits October 14, 2026 22:09
Bumps the prettier group with 1 update: [prettier](https://github.com/prettier/prettier).


Updates `prettier` from 3.9.9 to 3.9.10
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](prettier/prettier@3.9.9...3.9.10)

---
updated-dependencies:
- dependency-name: prettier
  dependency-version: 3.9.10
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: prettier
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps the prettier group with 1 update:
[prettier](https://github.com/prettier/prettier).

Updates `prettier` from 3.9.9 to 3.9.10
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/prettier/prettier/releases">prettier's
releases</a>.</em></p>
<blockquote>
<h2>3.9.10</h2>
<ul>
<li>Markdown: Update <code>micromark-extension-gfm-table</code> to fix
the table parse issue on performance (<a
href="https://redirect.github.com/prettier/prettier/pull/20266">#20266</a>
by <a href="https://github.com/fisker"><code>@​fisker</code></a>)</li>
</ul>
<p>🔗 <a
href="https://github.com/prettier/prettier/blob/3.9.10/CHANGELOG.md#3910">Changelog</a></p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/prettier/prettier/blob/main/CHANGELOG.md">prettier's
changelog</a>.</em></p>
<blockquote>
<h1>3.9.10</h1>
<p><a
href="https://github.com/prettier/prettier/compare/3.9.9...3.9.10">diff</a></p>
<h4>Markdown: Update <code>micromark-extension-gfm-table</code> to fix
the table parse issue on performance (<a
href="https://redirect.github.com/prettier/prettier/pull/20266">#20266</a>
by <a href="https://github.com/fisker"><code>@​fisker</code></a>)</h4>
<p>See <a
href="https://github.com/micromark/micromark-extension-gfm-table/commit/4f43ead37b786bc531d924530d4ab4c714886267">https://github.com/micromark/micromark-extension-gfm-table/commit/4f43ead37b786bc531d924530d4ab4c714886267</a>
for details.</p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/prettier/prettier/commit/1172b82c295c4f889fd787dc6c78c3e194ebf353"><code>1172b82</code></a>
Release 3.9.10</li>
<li><a
href="https://github.com/prettier/prettier/commit/d0142273aff2c76f8a69785d42ee2cedc4b0aaa3"><code>d014227</code></a>
Update <code>micromark-extension-gfm-table</code> to fix the table parse
issue on perfor...</li>
<li><a
href="https://github.com/prettier/prettier/commit/953b9084329dcd06ed1072a04b333f1e6e9371e8"><code>953b908</code></a>
Bump Prettier dependency to 3.9.9</li>
<li><a
href="https://github.com/prettier/prettier/commit/ad8a6bf4fa23c42fd114683fec43b28a11bd24af"><code>ad8a6bf</code></a>
Clean changelog_unreleased</li>
<li>See full diff in <a
href="https://github.com/prettier/prettier/compare/3.9.9...3.9.10">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=prettier&package-manager=npm_and_yarn&previous-version=3.9.9&new-version=3.9.10)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions


</details>
@cldmv-bot cldmv-bot Bot added ! release → master v4 flow: persistent next → master release PR (carries the next feature release) release Marks a pull request as a pending release — merge to publish a new version semver: patch This release contains only backwards-compatible bug fixes release: deps-only Release PR that only touches devDependencies, lockfiles and CI config — held, not released type: dependencies Relates to dependency updates, version bumps, or package management labels Oct 14, 2026
@cldmv-bot

cldmv-bot Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor Author

🔒 Dependency Review

  • ✅ 0 vulnerable package(s)
  • ✅ 0 package(s) with incompatible licenses
  • ✅ 0 package(s) with invalid SPDX license definitions
  • ✅ 0 package(s) with unknown licenses
  • ✅ 0 denied package(s)
  • ✅ 0 package(s) with OpenSSF Scorecard score < 3

Full job summary

@cldmv-bot

cldmv-bot Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor Author

⚠️ Bundle size increased

File Raw Δ Raw Gzipped Δ Gzipped
bin/fix-headers.mjs 55.6 kB +3.8 kB (+7.2%) ⚠️ 19.0 kB +1.4 kB
dist/index.cjs 1.6 kB — 940 B —
dist/index.mjs 46.0 kB +3.4 kB (+7.9%) ⚠️ 16.0 kB +1.3 kB
Total 103.2 kB +7.1 kB 35.9 kB +2.7 kB

📊 Generated by bundle-size. Brotli sizes also measured but omitted from the table for brevity.

Shinrai and others added 6 commits October 30, 2026 20:36
…d moves to its own block below the header, never deleted (#160)

A header rewrite replaced the whole matched comment, so description lines and any other non-field text in it were dropped. Those lines are now kept verbatim and in order: with the new strictHeaderBlock option (default true) they go to their own comment block directly below the header, in the file's comment style (block, HTML or # lines); with strictHeaderBlock: false (CLI --no-strict-header-block) they stay inside the header after the fields. Moving them is not a content edit, so @last modified by is kept.
…s above a # header; diff covers the moved block (#160)

Review follow-up for the header-block text move:
- A managed tag is a field only the first time it appears in a header comment; a repeated @author or @copyright (a third-party notice) and a dash line among text are kept as text.
- A line directly after a field, indented further or without the comment prefix, is that field's wrapped value and is rewritten with it.
- In a # header, comment lines directly above the first field (coding line, #cloud-config, modelines) stay above the header.
- --diff / --sample-output compare against everything that replaced the old header, so moved text shows as moved, not deleted.
- --strict-header-block [true|false] joins --no-strict-header-block.
- The moved block uses the file's own line ending.
…ly directive lines stay above a # header (#160)

The continuation class deleted text fix-headers did not write (a star-less description, a co-author line, a licence line under @copyright). Every non-field line is now text: moved below the header in strict mode, kept inside it after the fields otherwise. Only directive-shaped lines at the top of a # header (coding declaration, #cloud-config, yaml-language-server and vim/vi/ex modelines) keep their place above it; any other comment line there is header text.
…o it on a later run (#160)

A comment after the header is only absorbed as a stacked header when its first non-empty line is @project:, and a moved block that would start with a @project: line is written with a lead line, so a second strict run no longer reads the moved lines as fields and drops them. Encoding declarations stay above a # header only on the file's first two lines and only as a PEP 263 coding word; vim/vi/ex modelines only at the start of the comment text, so prose such as 'Decoding: base64' or 'like vi: modal' is header text.
…d moves to its own block below the header, never deleted (#160) (#161)
@cldmv-bot cldmv-bot Bot added area: core Touches core library / runtime source code area: tests Touches test files, fixtures, or test infrastructure type: documentation Relates to docs, README updates, guides, or inline code comments labels Oct 31, 2026
@cldmv-bot cldmv-bot Bot changed the title release: v2.2.3 - bump prettier from 3.9.9 to 3.9.10 in the prettier… release: v2.2.3 - text inside an existing header that isn't a header… Oct 31, 2026
@cldmv-bot cldmv-bot Bot added type: bug Something is broken or not behaving as expected and removed release: deps-only Release PR that only touches devDependencies, lockfiles and CI config — held, not released labels Oct 31, 2026
Shinrai and others added 4 commits October 31, 2026 14:08
Supersedes the open Dependabot bumps #159 (patch group, next) and the
hotfixes redirects #147, #149, #151 and #154. Every version those PRs
targeted is met or exceeded: vitest/@vitest/coverage-v8 5.0.5,
@cldmv/vitest-runner 1.5.6, @cldmv/configs 1.3.0, @cldmv/jsonv 1.1.5,
@cldmv/eslint-plugin-jsonv 1.0.17, @cldmv/prettier-plugin-jsonv 1.1.4,
eslint 10.14.0, @eslint/css 2.0.1, @eslint/json 2.1.1, vite 8.3.5,
rolldown 1.2.16, postcss 8.5.32, nanoid 3.3.20, source-map-js 1.2.2.
Lockfile only; no package.json range changes.
@cldmv-bot
cldmv-bot Bot merged commit bac3d68 into master Oct 31, 2026
43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: core Touches core library / runtime source code area: tests Touches test files, fixtures, or test infrastructure ! release → master v4 flow: persistent next → master release PR (carries the next feature release) release Marks a pull request as a pending release — merge to publish a new version semver: patch This release contains only backwards-compatible bug fixes type: bug Something is broken or not behaving as expected type: dependencies Relates to dependency updates, version bumps, or package management type: documentation Relates to docs, README updates, guides, or inline code comments

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A full pass deletes description text that sits inside an existing header block after the copyright line

1 participant