feat: add mapping sync check and improve vimdoc (#6)
Some checks are pending
luarocks / quality (push) Waiting to run
luarocks / publish (push) Blocked by required conditions

* feat(doc): fix phrasing

* ci: add upstream mapping sync check to quality workflow

Problem: mapping.lua can silently fall behind the ya2s/nonicons font
repo with no indication that new icons are available.

Solution: add a mapping-sync job that fetches nonicon.json from
upstream, generates the expected mapping.lua, and fails the check
if they differ.

* fix: sort alphabetically

* fix(ci): dont respect alphabetical order in font checker
This commit is contained in:
Barrett Ruth 2026-02-17 21:07:32 -05:00 committed by GitHub
parent 6b4f5cf150
commit 17aa14259a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 213 additions and 78 deletions

View file

@ -87,3 +87,26 @@ jobs:
run: pnpm add -g prettier@3.1.0
- name: Check markdown formatting with prettier
run: prettier --check .
mapping-sync:
name: Mapping Sync Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check mapping against upstream
run: |
curl -sL https://raw.githubusercontent.com/ya2s/nonicons/main/src/template/nonicon.json \
| jq -r 'to_entries[] | "\(.key | sub("-16$"; "")) \(.value)"' \
| sort > /tmp/upstream.txt
grep -oP "^\s*\['\K[^']+(?='\]\s*=\s*\d)" lua/nonicons/mapping.lua \
| while read -r key; do
val=$(grep -oP "^\s*\['${key}'\]\s*=\s*\K\d+" lua/nonicons/mapping.lua)
echo "$key $val"
done | sort > /tmp/local.txt
if ! diff -u /tmp/local.txt /tmp/upstream.txt; then
echo ''
echo '::warning::mapping.lua is out of sync with ya2s/nonicons upstream'
exit 1
fi