A Prettier version bump changes Prettier's canonical output. Files that were correctly formatted under the old version then fail prettier --check in CI — so the Renovate update PR goes red and never automerges.
Observed on mars3142/castaway right now: both open Renovate PRs (#30 devDependencies, #33 lockfile maintenance) bump prettier 3.8.3 → 3.9.6. The new Prettier reformats two pre-existing files:
File
Change wanted by 3.9
src/lib/server/db/index.ts
union type ShellReason collapsed from 6 lines to one
src/lib/components/ui/textarea/textarea.svelte
{...restProps} pulled onto the closing-tag line
main is green (it runs 3.8.3), so the fix cannot live on main — 3.8.3 would then reject the 3.9 style. The reformat must travel with the bump, which is exactly what a post-upgrade task does.
Change
A single npm-scoped postUpgradeTasks:
{"matchManagers":["npm"],"postUpgradeTasks":{"commands":["npm run format --if-present"],"fileFilters":["**/*"],"executionMode":"branch"}}
--if-present → no-op in npm repos that have no format script (no failure).
matchManagers: ["npm"] → never fires in the gradle/maven (spring + kotlin) or firmware repos that share this preset.
executionMode: "branch" → runs once per branch after all upgrades, then commits the reformatted files.
⚠️ Second half is not in this repo
postUpgradeTasks only executes if the self-hosted Renovate instance whitelists the command. That is a global/self-hosted-only option and cannot be set from this preset:
RENOVATE_ALLOWED_COMMANDS=^npm run format
(or the equivalent allowedCommands in the bot's config.js). Without it, the task is silently skipped and the PRs stay red.
Effect on the two castaway PRs
Once the bot has allowedCommands, Renovate's Monday rebase of #30/#33 will run npm run format, commit the reformat, CI turns green, and both automerge — no manual push, so they stay Renovate-owned.
## Problem
A Prettier **version bump** changes Prettier's canonical output. Files that were correctly formatted under the old version then fail `prettier --check` in CI — so the Renovate update PR goes **red and never automerges**.
Observed on `mars3142/castaway` right now: both open Renovate PRs (#30 devDependencies, #33 lockfile maintenance) bump prettier `3.8.3 → 3.9.6`. The new Prettier reformats two pre-existing files:
| File | Change wanted by 3.9 |
|---|---|
| `src/lib/server/db/index.ts` | union type `ShellReason` collapsed from 6 lines to one |
| `src/lib/components/ui/textarea/textarea.svelte` | `{...restProps}` pulled onto the closing-tag line |
`main` is green (it runs 3.8.3), so the fix **cannot** live on `main` — 3.8.3 would then reject the 3.9 style. The reformat must travel *with* the bump, which is exactly what a post-upgrade task does.
## Change
A single npm-scoped `postUpgradeTasks`:
```json
{
"matchManagers": ["npm"],
"postUpgradeTasks": {
"commands": ["npm run format --if-present"],
"fileFilters": ["**/*"],
"executionMode": "branch"
}
}
```
- **`--if-present`** → no-op in npm repos that have no `format` script (no failure).
- **`matchManagers: ["npm"]`** → never fires in the gradle/maven (`spring + kotlin`) or firmware repos that share this preset.
- **`executionMode: "branch"`** → runs once per branch after all upgrades, then commits the reformatted files.
## ⚠️ Second half is not in this repo
`postUpgradeTasks` only executes if the **self-hosted** Renovate instance whitelists the command. That is a global/self-hosted-only option and **cannot** be set from this preset:
```
RENOVATE_ALLOWED_COMMANDS=^npm run format
```
(or the equivalent `allowedCommands` in the bot's `config.js`). Without it, the task is silently skipped and the PRs stay red.
## Effect on the two castaway PRs
Once the bot has `allowedCommands`, Renovate's Monday rebase of #30/#33 will run `npm run format`, commit the reformat, CI turns green, and both automerge — no manual push, so they stay Renovate-owned.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_018dVH5RiPsudxH4wV74ucEs
A prettier version bump changes prettier's canonical output, so files
that were correctly formatted under the old version now fail
`prettier --check` in CI — the update PR goes red and never automerges.
This happened on castaway with prettier 3.8.3 -> 3.9.6 (two files
reformatted: a union type collapsed to one line, a Svelte closing tag
pulled onto the attribute line).
Add a npm-scoped postUpgradeTasks that runs `npm run format` once per
branch after the upgrade and commits the result. `--if-present` makes it
a no-op in npm repos without a format script; matchManagers npm keeps it
away from the gradle/maven and firmware repos that share this preset.
Requires the self-hosted Renovate instance to whitelist the command via
allowedCommands (e.g. RENOVATE_ALLOWED_COMMANDS='^npm run format') — that
is a global/self-hosted-only option and cannot be set from this preset.
Signed-off-by: Peter Siegmund <peter.siegmund@entwicklung.eq-3.de>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Problem
A Prettier version bump changes Prettier's canonical output. Files that were correctly formatted under the old version then fail
prettier --checkin CI — so the Renovate update PR goes red and never automerges.Observed on
mars3142/castawayright now: both open Renovate PRs (#30 devDependencies, #33 lockfile maintenance) bump prettier3.8.3 → 3.9.6. The new Prettier reformats two pre-existing files:src/lib/server/db/index.tsShellReasoncollapsed from 6 lines to onesrc/lib/components/ui/textarea/textarea.svelte{...restProps}pulled onto the closing-tag linemainis green (it runs 3.8.3), so the fix cannot live onmain— 3.8.3 would then reject the 3.9 style. The reformat must travel with the bump, which is exactly what a post-upgrade task does.Change
A single npm-scoped
postUpgradeTasks:--if-present→ no-op in npm repos that have noformatscript (no failure).matchManagers: ["npm"]→ never fires in the gradle/maven (spring + kotlin) or firmware repos that share this preset.executionMode: "branch"→ runs once per branch after all upgrades, then commits the reformatted files.⚠️ Second half is not in this repo
postUpgradeTasksonly executes if the self-hosted Renovate instance whitelists the command. That is a global/self-hosted-only option and cannot be set from this preset:(or the equivalent
allowedCommandsin the bot'sconfig.js). Without it, the task is silently skipped and the PRs stay red.Effect on the two castaway PRs
Once the bot has
allowedCommands, Renovate's Monday rebase of #30/#33 will runnpm run format, commit the reformat, CI turns green, and both automerge — no manual push, so they stay Renovate-owned.🤖 Generated with Claude Code
https://claude.ai/code/session_018dVH5RiPsudxH4wV74ucEs