Repository navigation
feat: support .mts/.cts and add a C/C++ detector - #193
Merged
Merged
Conversation
The node detector now handles .mts and .cts. A new c detector covers .c .h .cc .cpp .cxx .hh .hpp .hxx with a plain /* */ header at the top, above #include, #pragma once and include guards. Third-party C is left alone: a file whose prologue (comments, blank lines and preprocessor directives before the first line of code) holds a license or copyright notice that is not a fix-headers header is skipped, so a vendored SQLite amalgamation keeps its own notice. Resolves #192
Shinrai
approved these changes
Nov 25, 2026
This was referenced Nov 25, 2026
Shinrai
added a commit
that referenced
this pull request
Nov 25, 2026
cldmv-bot Bot
added a commit
that referenced
this pull request
Nov 25, 2026
# `@cldmv/fix-headers` v2.3.0 Changelog **Release Date**: November 2026 **Release Type**: Minor **Branch**: `release/2.3.0` --- ## Overview Version 2.3.0 adds two kinds of files. The `node` detector now handles TypeScript's `.mts` and `.cts` extensions, and a new `c` detector stamps C and C++ sources and headers (`.c .h .cc .cpp .cxx .hh .hpp .hxx`). Vendored C is left alone: a C file whose opening comments carry someone else's license or copyright notice is skipped and reported in `skipped`, so a bundled library such as the SQLite amalgamation keeps its own notice. Header output for every file type that was already supported is unchanged. --- ## ✨ Features ### `.mts` and `.cts` in the `node` detector ([#193](#193)) `.mts` and `.cts` files get the same `/** … */` header as `.ts`. A repo-wide run now stamps them instead of skipping them as unhandled. ### New `c` detector for C and C++ ([#193](#193)) The `c` detector is on by default and covers `.c`, `.h`, `.cc`, `.cpp`, `.cxx`, `.hh`, `.hpp` and `.hxx`. The header is a plain `/* … */` comment (not `/** … */`, so Doxygen doesn't take it as the documentation of the first declaration), placed at the top of the file above `#include`, `#pragma once` and include guards. Turn it off with `disabledDetectors: ["c"]`. ### Third-party C is skipped ([#193](#193)) The detector reads a C file's prologue (its comments, blank lines and preprocessor lines up to the first line of code). If any comment there mentions a copyright, a license, an `SPDX-License-Identifier` or "public domain" and isn't a fix-headers header, the file is reported in `skipped` and its bytes are not touched. This catches the SQLite amalgamation, whose public-domain notice sits below a few `#define` lines. A file whose first comment is already a fix-headers header is always treated as the project's own. Whole vendor folders can still be left out with `excludeFolders` / `--exclude-folder`. Fixes [#192](#192). ## 🔧 CI & tooling - `ci.yml` synced with the CLDMV/.github v4.43.0 template, so the release PR no longer reruns the test matrix on a commit its push run already tested ([#191](#191)). ## 📚 Documentation - **NEW:** [docs/changelog/v2/v2.3.0.md](https://github.com/CLDMV/fix-headers/blob/v2.3.0/docs/changelog/v2/v2.3.0.md): this changelog. - README: the supported-file-types table lists `.mts`/`.cts` and the `c` detector, and the skip rules describe how third-party C is detected ([#193](#193)). - README What's New promoted to v2.3.0. ## 🔧 Dependencies Development only ([#189](#189)): - `@cldmv/eslint-plugin-jsonv` 1.0.17 → 1.1.2 - `@cldmv/jsonv` 1.1.5 → 1.2.2 - `@cldmv/prettier-plugin-jsonv` 1.1.4 → 1.2.2 - `@cldmv/vitest-runner` 1.5.6 → 1.6.1 - `eslint` 10.14.0 → 10.15.0 - `prettier` 3.9.10 → 3.10.1 --- ## Upgrade notes - No breaking changes; drop-in for v2.2.7. - A repo-wide run now also stamps `.mts`, `.cts` and C/C++ files that were skipped before. Add `"c"` to `disabledDetectors`, or exclude the folders, if you don't want that. - A project C file whose opening comment mentions a copyright or license (and isn't a fix-headers header yet) is skipped as third-party; the reason is shown in the run output. <details> <summary>👥 Contributors</summary> - @Shinrai </details> --- <!-- coverage-start -->  | Metric | Coverage | |--------|----------| | Statements | 99.9% | | Branches | 98.8% | | Functions | 100.0% | | Lines | 99.9% | *Avg: **99.6%** · `5d93a9f` · Node lts/** <!-- coverage-end --> <!-- co-authors --> Co-authored-by: Shinrai <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
.mts/.ctsto the node detector and a newcdetector for.c .h .cc .cpp .cxx .hh .hpp .hxx(plain/* */header at the top, above#include/#pragma once/ include guards).Vendored C is skipped: a file whose prologue has a license/copyright notice that isn't a fix-headers header is left untouched, so the SQLite amalgamation keeps its own notice.
Resolves #192