3 Commits

Author SHA1 Message Date
Mikkeli Matlock 5212b7806b fix: remove a stray CR byte from .gitattributes
The previous commit wrote a literal carriage-return byte into a comment, where
the text was meant to show the two characters backslash-r. Git's content sniffing
treats a lone CR as a sign of binary data, so .gitattributes itself was classed
-text (git ls-files --eol reported i/-text): the one file in the template that
the new LF policy could not normalise, and one every repo created from it would
have inherited.

The rules themselves were never affected - the byte sat inside a comment.

The comment now says "a trailing CR byte" in words. .gitattributes reports
i/lf w/lf, and `git add --renormalize .` stages nothing else.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LU1NRL7fAaZTtFMTTPn2b1
2026-09-14 01:41:39 +09:00
Mikkeli Matlock 3abbb06073 chore: pin LF line endings in .gitattributes
The branding toolkit reads tools/branding-sites.tsv line by line with `read`.
On Windows, Git for Windows' default core.autocrlf=true checks that file out as
CRLF, so every row's last field - the pattern - gains a trailing \r and matches
nothing. In a child repo this made check-branding.sh report all 29 of its sites
as missing on Windows while the same commit passed on the Linux CI runner, and
brand-plugin.sh uses that same field as its sed search pattern. Only *.sh was
pinned to LF, which protected the scripts but not their data.

This is the template, so the fix belongs here: every repo created from it
inherits the policy instead of rediscovering the bug.

    * text=auto eol=lf       LF in the repo and every working tree, every OS
    *.sh text eol=lf         kept explicit: a CRLF shebang is a hard failure
    *.bat/*.cmd eol=crlf     the one exception; cmd.exe misparses LF batch files

An attribute beats core.autocrlf, so a fresh clone gets LF however its machine
is configured. Verified in a throwaway repo under autocrlf=true.

No blob changes: every committed blob was already LF, and
`git add --renormalize .` stages nothing but this file. Working tree
re-checked-out to match (14 files CRLF -> LF). Checker 38 passed / 0 failed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LU1NRL7fAaZTtFMTTPn2b1
2026-09-14 01:39:17 +09:00
mikkeli 1ddba77c28 feat: add a branding consistency checker
Adapted from musiikki/codename-206, where the same script guards a single
plugin. It matters more here: renaming is the first thing anyone does with
a template, and identity is duplicated across Cargo.toml, bundler.toml,
src/lib.rs and the docs with nothing keeping them in agreement. A
half-finished rename builds a bundle under one name while the docs and
deploy script look for another.

Changes from the codename-206 original:

- Checks for files this repo does not ship (deploy.ps1) report as `skip`
  rather than FAIL, and start enforcing once the file appears.
- STALE ships pre-seeded with this template's own placeholders, and each
  entry is skipped while it is still part of a canonical value. That makes
  renaming self-checking: entries arm themselves as you change the value
  they belong to, with no bookkeeping. Substring rather than equality,
  because placeholders nest — "your-domain" lives inside the canonical
  CLAP_ID.
- Covers identity this template carries that codename-206's did not:
  VENDOR, EMAIL, the Cargo homepage feeding Plugin::URL, that the `env!`
  indirection is still in place, and the README's bundle command.
- Asserts CLAP_ID is reverse-DNS safe. A stray capital or space there is
  not a compile error, it is a silent identity change between machines.

Two placeholder spellings had to move to avoid false positives, since a
checker that cries wolf trains you to ignore it: bundler.toml's comment
contained the literal "Plugin Name", and the CLAP_ID TODO spelled the
placeholder a third way that matched neither the constant nor the STALE
list. The TODO now illustrates the form instead of repeating a placeholder.

.gitattributes pins *.sh to LF so core.autocrlf=true on Windows cannot
check the script out with a CRLF shebang that dash rejects.

Verified three ways: clean template passes, a partial rename names every
drifted file, and a complete rename passes and still compiles.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WHt4DykxXaQnyaJfyS8KCn
2026-08-29 10:24:52 +09:00