fix(ci): stop accented theme names from false-colliding in the gate#29
Merged
Conversation
…don't false-collide
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.
The bug
The 20-theme pack (#23) failed the gate with three "already exists" errors — and only for the accented names: Catppuccin Frappé, Rosé Pine Dawn, Rosé Pine Moon. The non-accented themes passed.
theme-check-ci.tsreconstructs each catalogue theme's file path to exclude the ones being changed. Its inline path builder usedname.toLowerCase().replace(/[^a-z0-9]+/g, "-")— which turnséinto a hyphen: "Rosé Pine Dawn" →ros-pine-dawn. But the real file isrose-pine-dawn.toml(the correct slug strips the accent, é→e). The two never matched, so the just-added theme wasn't excluded from the catalogue it's checked against — and collided with itself.The fix
Use the project's own
slugify(exported fromcheck-themes.ts, already NFD-normalizing and accent-stripping) instead of a divergent inline copy. It's the same function the filename rule uses, so the reconstructed path now always matches the real file.Reproduced the exact failure against the three accented pack themes; with the fix the gate reports "theme check passed". The
slugifyaccent behavior is already covered by a test ("Rosé Pine"→"rose-pine"), and pathOf now routes through it.