Skip to content

Commit 639df09

Browse files
luanpotterspydon
andauthored
ci: Fix alphabetization check in cspell verify script (#3729)
Fix alphabetization check in cspell verify script; it was using non-bash-compliant code that would not actually work on certain systems; in fact, it was not working on CI, which has caused some drift. This also fixes the dictionaries. Co-authored-by: Lukas Klingsbo <me@lukas.fyi>
1 parent d1698c4 commit 639df09

5 files changed

Lines changed: 20 additions & 14 deletions

File tree

.github/.cspell/flame_dictionary.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ spineboy # Name of a famous character used as an example for Spine https://en.es
2020
spineboys # Plural of spineboy
2121
Spritecow # A handy tool for locating sprites within a spritesheet http://www.spritecow.com/
2222
Supabase # Supabase, one of our sponsors https://supabase.com/
23+
terminui # A terminal UI library for Flutter
2324
texturepacker # a packed spritesheet format
2425
Tilemap # What tile maps are called within Tiled
2526
vantablack # brand name for a famous super-black ink known as the darkest ever made
2627
Weasley # Ron Weasley, a character from the book Harry Potter
2728
Wyrmsun # An open-source real-time strategy game https://www.indiedb.com/games/wyrmsun
2829
yarnspinner # A tool for building branching narrative and dialogue in games # https://yarnspinner.dev/
29-
terminui # A terminal UI library for Flutter

.github/.cspell/gamedev_dictionary.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ backgrounded # moving the app to the background
1111
backgrounding # moving the app to the background
1212
backpressure # strategy to deal with excess flow of data
1313
backquote # another word for backtick
14+
BGRA # blue green red alpha
1415
bimedian # line segment joining the midpoints of opposite sides of a shape
1516
bitfield # data structure consisting of adjacent bits
1617
broadphase # common division of collision detection between broad and narrow phases
@@ -25,10 +26,10 @@ highp # high float precission setting on glsl fragment shaders
2526
hitbox # the collision box around objects for the purposes of collision detection
2627
hitboxes # plural of hitbox
2728
IDAT # PNG data chunk
28-
IHDR # PNG header chunk
2929
IEND # PNG end chunk
30-
ints # short for integers
30+
IHDR # PNG header chunk
3131
impellerc # Flutter's impeller compiler
32+
ints # short for integers
3233
jank # stutter or inconsistent gap or timing
3334
lerp # short for linear interpolation
3435
LTRB # left top right bottom
@@ -53,24 +54,23 @@ raycasts # plural of raycast
5354
raytrace # act of raytracing
5455
raytracing # rendering techniques that calculates light rays as straight lines
5556
rects # plural of rect
56-
respawned # past tense of respawn
5757
respawn # when the player character dies and is brought back after some time and penalties
58+
respawned # past tense of respawn
5859
retarget # to direct (something) toward a different target
5960
RGBA # red green blue alpha
6061
RGBO # red green blue opacity
61-
BGRA # blue green red alpha
6262
rrect # rounded rect
6363
scos # cosine of a rotation multiplied by the scale factor
6464
shaderbundle # a file extension used to bundle shaders for GLSL
6565
slerp # short for spherical linear interpolation, a method to interpolate quaternions
6666
spritesheet # a single image packing multiple sprites, normally in a grid
6767
ssin # sine of a rotation multiplied by the scale factor
68+
struct # a type of data model in programming that aggregates fields
6869
stylesheet # name of a CSS style file
6970
subfolders # plural of subfolders
7071
sublist # any sub-set of elements of a given list
7172
sublists # plural of sublist
7273
subrange # a range entirely contained on a given range
73-
struct # a type of data model in programming that aggregates fields
7474
SVGs # plural of SVG
7575
texel # equivalent of pixel for a texture image, a normalized coordinate system for ease of mapping
7676
texels # plural of texel

.github/.cspell/people_usernames.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ fröber # github.com/Brixto
99
gnarhard # github.com/gnarhard
1010
kenney # kenney.nl
1111
Klingsbo # github.com/spydon
12+
luan # github.com/luanpotter
1213
luanpotter # github.com/luanpotter
1314
Lukas # github.com/spydon
1415
pgainullin # github.com/pgainullin
1516
Schnurber # github.com/schnurber
16-
subosito # github.com/subosito
1717
spydon # github.com/spydon
1818
stpasha # github.com/stpasha
19+
subosito # github.com/subosito
1920
tavian # tavianator.com
2021
Tellinghuisen # Author of Statistical Error Propagation (2001)
2122
videon # github.com/markvideon
2223
wolfenrain # github.com/wolfenrain
2324
xaha # github.com/xvrh
24-
luan # github.com/luanpotter

.github/.cspell/words_dictionary.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ bloodlust
33
collidable
44
collidables
55
draggables
6+
endianness
67
focusable
78
gamepad
89
gamepads
@@ -32,4 +33,3 @@ tappable
3233
tappables
3334
toolset
3435
underutilize
35-
endianness

scripts/cspell-verify.sh

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,20 @@ set -e
33

44
fix=$([[ "$*" == *--fix* ]] && echo true || echo false)
55

6-
function sort_fn() {
7-
sort --ignore-case -C
6+
function sort_check_fn() {
7+
sort -f -c
8+
}
9+
10+
function sort_run_fn() {
11+
sort -f
812
}
913

1014
function sort_dictionary() {
1115
local file="$1"
1216
local tmp_file=$(mktemp)
1317

1418
head -n 1 "$file" > "$tmp_file"
15-
tail -n +2 "$file" | sort_fn >> "$tmp_file"
19+
tail -n +2 "$file" | sort_run_fn >> "$tmp_file"
1620
mv "$tmp_file" "$file"
1721
}
1822

@@ -47,9 +51,11 @@ error=0
4751
for file in .github/.cspell/*.txt; do
4852
echo "Processing dictionary '$file'..."
4953

50-
violation=$(awk '!/^#/' "$file" | sort_fn 2>&1 || true)
54+
violation=$(awk '!/^\s*(#|$)/' "$file" | sort_check_fn 2>&1 || true)
5155
if [ -n "$violation" ]; then
52-
echo "Error: The dictionary '$file' is not in alphabetical order. First violation: '$violation'" >&2
56+
# Extract only the line content after the last ': '
57+
violation_line=$(echo "$violation" | sed 's/.*: //')
58+
echo "Error: The dictionary '$file' is not in alphabetical order. First violation: '$violation_line'" >&2
5359
error=1
5460
if $fix; then
5561
echo "Fixing the dictionary '$file'"

0 commit comments

Comments
 (0)