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
This commit is contained in:
@@ -13,8 +13,33 @@ cd my-plugin
|
||||
|
||||
# Edit: src/lib.rs, Cargo.toml, bundler.toml — replace placeholder values
|
||||
# See musiikki/codename-206 for a real-world example of how to fill these in
|
||||
|
||||
# Then verify the rename landed everywhere
|
||||
sh check-branding.sh
|
||||
```
|
||||
|
||||
## Renaming
|
||||
|
||||
Branding is duplicated across `Cargo.toml`, `bundler.toml`, `src/lib.rs` and the docs,
|
||||
and nothing makes those agree — so a half-finished rename builds a bundle under one name
|
||||
while the docs and deploy script look for another.
|
||||
|
||||
`check-branding.sh` declares the identity once at the top and asserts every copy matches:
|
||||
|
||||
```bash
|
||||
sh check-branding.sh # exit 0 = consistent, 1 = drift found
|
||||
```
|
||||
|
||||
To rename: edit the canonical block at the top of the script, run it, and fix everything
|
||||
it reports. The placeholder spellings are pre-seeded into its `STALE` list, and each one
|
||||
arms itself as soon as you change the matching canonical value — so leftovers surface
|
||||
without you having to track them. It also asserts `VST3_CLASS_ID` is exactly 16 bytes and
|
||||
that `CLAP_ID` is reverse-DNS safe, both of which are otherwise a compile error or a
|
||||
silent identity change between machines.
|
||||
|
||||
Checks for files the template doesn't ship (e.g. a `deploy.ps1`) report as `skip` and
|
||||
start enforcing once you add them.
|
||||
|
||||
## Build
|
||||
|
||||
```bash
|
||||
@@ -74,6 +99,8 @@ bundler.toml # Bundle name for `cargo xtask bundle`
|
||||
src/lib.rs # Plugin skeleton — params, DSP, and egui editor, with one example gain param
|
||||
xtask/ # Bundler xtask (cargo xtask bundle)
|
||||
.cargo/config.toml # xtask alias
|
||||
check-branding.sh # Asserts the plugin's identity strings agree everywhere (see Renaming)
|
||||
.gitattributes # Pins *.sh to LF so Windows checkouts keep a valid shebang
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
Reference in New Issue
Block a user