mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-04 05:20:30 +00:00
Meta: Add check-emoji script to validate emoji filenames
Verifies that emoji filenames: - Contain only uppercase letters, numbers, +, and _ - Use _ and a separator between codepoints, not + - Do not include the U+FE0F emoji presentation specifier
This commit is contained in:
parent
619ac65302
commit
68ff0a7d13
Notes:
sideshowbarker
2024-07-17 08:06:58 +09:00
Author: https://github.com/squeek502 Commit: https://github.com/SerenityOS/serenity/commit/68ff0a7d13 Pull-request: https://github.com/SerenityOS/serenity/pull/14917 Reviewed-by: https://github.com/Xexxa ✅ Reviewed-by: https://github.com/kleinesfilmroellchen Reviewed-by: https://github.com/linusg
2 changed files with 31 additions and 0 deletions
30
Meta/check-emoji.sh
Executable file
30
Meta/check-emoji.sh
Executable file
|
@ -0,0 +1,30 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -eo pipefail
|
||||
|
||||
script_path=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
|
||||
cd "${script_path}/.."
|
||||
|
||||
files=()
|
||||
for file in Base/res/emoji/*.png; do
|
||||
files+=("${file}")
|
||||
done
|
||||
|
||||
found_invalid_filenames=0
|
||||
for fn in "${files[@]}"; do
|
||||
basename=$(basename "$fn" .png)
|
||||
if [[ $basename =~ [^A-Z0-9+_] ]] ; then
|
||||
echo "$fn contains invalid characters in its filename. Only uppercase letters, numbers, +, and _ should be used."
|
||||
found_invalid_filenames=1
|
||||
fi
|
||||
if [[ $basename == *+U* ]] ; then
|
||||
echo "$fn is incorrectly named. _ should be used as a separator between codepoints, not +."
|
||||
found_invalid_filenames=1
|
||||
fi
|
||||
if [[ $basename == *_U+FE0F* ]] ; then
|
||||
echo "$fn should not include any emoji presentation selectors. U+FE0F codepoints should be removed from the filename."
|
||||
found_invalid_filenames=1
|
||||
fi
|
||||
done
|
||||
|
||||
exit $found_invalid_filenames
|
|
@ -22,6 +22,7 @@ set +e
|
|||
for cmd in \
|
||||
Meta/check-ak-test-files.sh \
|
||||
Meta/check-debug-flags.sh \
|
||||
Meta/check-emoji.sh \
|
||||
Meta/check-markdown.sh \
|
||||
Meta/check-newlines-at-eof.py \
|
||||
Meta/check-png-sizes.sh \
|
||||
|
|
Loading…
Reference in a new issue