1
0
Fork 0
mirror of https://github.com/vim/vim synced 2025-03-15 14:27:53 +01:00
vim/ci/hlgroups.make
Christ van Willegen 6a15942bc2
CI: add Makefile target to verify default highlighting groups are present
When adding new highlight groups, one needs to make sure to also add a
"default link NewHlGroup ExistingHlGroup" in highlight.c code, so that
when resetting a color scheme the old color won't be left behind.

So add a Makefile in the 'ci' directory that verifies that all
documented '*hl-<groupname>' from the documentation are either reflected
in the source code, or belong to a list of 'known to be ignored'
highlight groups and let that check run as part of the CI test suite.

related: 
closes: 

Signed-off-by: Christ van Willegen <cvwillegen@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-21 20:23:26 +01:00

18 lines
571 B
Makefile

# vim: ft=make
SHELL = /bin/bash
# Default target to actually run the comparison:
.PHONY: check
.INTERMEDIATE: hlgroups deflinks hlgroups.stripped
check: hlgroups.stripped deflinks
diff hlgroups.stripped deflinks
hlgroups:
grep '\*hl-' ../runtime/doc/*txt | sed -E -e 's/.*:<?\s*//' -e 's/hl-//g' -e 's/\*//g' -e 's/ /\n/g' | sort > hlgroups
deflinks: ../src/highlight.c
grep '"default link' $< | sed 's/.*default link\s*\(.*\)\s.*/\1/' | sort > deflinks
hlgroups.stripped: hlgroups.ignore hlgroups
grep -v -x -F -f hlgroups.ignore hlgroups > hlgroups.stripped