Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 17 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ The package has no runtime code and no dependencies. It ships the config files,

### Requirements

- A tool that can extend a shared config. For fix-headers that is **v2.0.0 or later**: `extends` arrives in [CLDMV/fix-headers#88](https://github.com/CLDMV/fix-headers/pull/88), and several of the options this config sets (`fixCreatedDate`, `normalizeDateFormat`, `strictCreatedDate`) in [CLDMV/fix-headers#67](https://github.com/CLDMV/fix-headers/pull/67). Older releases cannot resolve `extends` and ignore those options.
- A tool that can extend a shared config. For fix-headers that is **v2.0.0 or later**: `extends` arrives in [CLDMV/fix-headers#88](https://github.com/CLDMV/fix-headers/pull/88), and several of the options this config sets (`fixCreatedDate`, `normalizeDateFormat`, `strictCreatedDate`) in [CLDMV/fix-headers#67](https://github.com/CLDMV/fix-headers/pull/67). Older releases cannot resolve `extends` and ignore those options. Use **v2.2.0 or later** for the author rules: from 2.2.0, `@Last modified by` changes only when a file's content was edited ([CLDMV/fix-headers#128](https://github.com/CLDMV/fix-headers/pull/128)).

### Install

Expand Down Expand Up @@ -107,30 +107,32 @@ Each file is exposed through `package.json` `exports`, so it resolves by its spe
"companyName": "Catalyzed Motivation Inc.",
"copyrightStartYear": 2013,
"forceAuthorUpdate": false,
"forceLastModifiedAuthorUpdate": true,
"forceLastModifiedAuthorUpdate": false,
"fixCreatedDate": true,
"normalizeDateFormat": true,
"strictCreatedDate": true,
"margin": 1
}
```

| Option | Value | Effect |
| ------------------------------- | ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| `includeFolders` | `["."]` | Scan the whole project; ignore files (`.gitignore` and everything else git honours) still exclude what they list |
| `useGpgSignerAuthor` | `true` | Take the `@Author` name from the user ID of the OpenPGP key git signs commits with |
| `company` | `"CLDMV"` | Write `@Author` as `Name <CLDMV>` |
| `companyName` | `"Catalyzed Motivation Inc."` | The copyright holder in `@Copyright`. fix-headers v2 has no built-in holder and otherwise reads it from the manifest author (`CLDMV`) |
| `copyrightStartYear` | `2013` | The first year of the `@Copyright` range, for every file |
| `forceAuthorUpdate` | `false` | Never rewrite an existing `@Author` / `@Email`; they record who created the file. A missing value is still filled in |
| `forceLastModifiedAuthorUpdate` | `true` | Always rewrite `@Last modified by` to the detected values |
| `fixCreatedDate` | `true` | Move an existing `@Date` back to the oldest of itself, the file's first git commit and its filesystem creation time |
| `normalizeDateFormat` | `true` | Write every header date in the git `%aI` form (`2026-03-01T17:59:32-08:00`) |
| `strictCreatedDate` | `true` | With `--check`, fail on an `@Date` later than the file's first commit or creation time instead of only warning |
| `margin` | `1` | One blank line between the header and the file's next content. The fix-headers default is two, which prettier collapses to one |
| Option | Value | Effect |
| ------------------------------- | ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `includeFolders` | `["."]` | Scan the whole project; ignore files (`.gitignore` and everything else git honours) still exclude what they list |
| `useGpgSignerAuthor` | `true` | Take the `@Author` name from the user ID of the OpenPGP key git signs commits with |
| `company` | `"CLDMV"` | Write `@Author` as `Name <CLDMV>` |
| `companyName` | `"Catalyzed Motivation Inc."` | The copyright holder in `@Copyright`. fix-headers v2 has no built-in holder and otherwise reads it from the manifest author (`CLDMV`) |
| `copyrightStartYear` | `2013` | The first year of the `@Copyright` range, for every file |
| `forceAuthorUpdate` | `false` | Never rewrite an existing `@Author` / `@Email`; they record who created the file. A missing value is still filled in |
| `forceLastModifiedAuthorUpdate` | `false` | `@Last modified by` follows real edits: it changes only when a file's content was edited, not when fix-headers only rewrites the header (fix-headers 2.2.0+) |
| `fixCreatedDate` | `true` | Move an existing `@Date` back to the oldest of itself, the file's first git commit and its filesystem creation time |
| `normalizeDateFormat` | `true` | Write every header date in the git `%aI` form (`2026-03-01T17:59:32-08:00`) |
| `strictCreatedDate` | `true` | With `--check`, fail on an `@Date` later than the file's first commit or creation time instead of only warning |
| `margin` | `1` | One blank line between the header and the file's next content. The fix-headers default is two, which prettier collapses to one |

An existing `@Author` is never rewritten: it records who created the file, and this config sets `forceAuthorUpdate` to `false` explicitly so the decision is visible and wins over anything earlier in an `extends` chain. A repository can turn it on in its own config for a one-off migration of old author names.

`@Last modified by` records the last person to edit the file. With fix-headers 2.2.0 or later it changes only when the file's content was edited; a run that only rewrites the header (date format, spacing, a corrected `@Date`) updates `@Last modified time` but keeps `@Last modified by`. This config therefore sets `forceLastModifiedAuthorUpdate` to `false` as well. With fix-headers before 2.2.0 that setting keeps the existing `@Last modified by` on every run, so upgrade fix-headers alongside this config.

The full description of every option is in the [fix-headers README](https://github.com/CLDMV/fix-headers#readme).

### Using it by URL
Expand Down
2 changes: 1 addition & 1 deletion fix-headers.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"companyName": "Catalyzed Motivation Inc.",
"copyrightStartYear": 2013,
"forceAuthorUpdate": false,
"forceLastModifiedAuthorUpdate": true,
"forceLastModifiedAuthorUpdate": false,
"fixCreatedDate": true,
"normalizeDateFormat": true,
"strictCreatedDate": true,
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
},
"devDependencies": {
"@cldmv/eslint-plugin-jsonv": "^1.0.13",
"@cldmv/fix-headers": "^2.1.4",
"@cldmv/fix-headers": "^2.2.0",
"@cldmv/jsonv": "^1.1.1",
"@cldmv/prettier-plugin-jsonv": "^1.1.0",
"@cldmv/vitest-runner": "^1.5.1",
Expand Down
Loading