Skip to content

Commit b7f8080

Browse files
authored
Merge pull request #3843 from ClickHouse/fix_aspell
Fix aspell
2 parents b46e22a + f97d902 commit b7f8080

File tree

3 files changed

+29
-3
lines changed

3 files changed

+29
-3
lines changed

scripts/aspell-dict-file.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1054,4 +1054,4 @@ allowlist
10541054
--docs/integrations/data-ingestion/azure-data-factory/overview.md--
10551055
microsoft
10561056
--docs/integrations/data-ingestion/azure-data-factory/index.md--
1057-
microsoft
1057+
microsoft

scripts/aspell-ignore/en/aspell-dict.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3517,4 +3517,5 @@ minSimpleState
35173517
maxSimpleState
35183518
TimescaleDB
35193519
columnstore
3520-
3520+
TiDB
3521+
resync

scripts/check-doc-aspell

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,32 @@ get_ignore_words_for_file() {
6767
# Use this to filter out lines we don't wanna consider in spell-check - slugs, imports, and img src JSX elements
6868
preprocess_file() {
6969
local file=$1
70-
sed -E 's/\{#[^}]*\}//g' "$file" | grep -Ev '^(slug:|import [[:alnum:]_, {}*]+ from .+;?|<img src=\{[^}]+\})'
70+
71+
# Remove YAML frontmatter (everything between the first --- and second --- lines)
72+
# Then apply other existing filters
73+
awk '
74+
BEGIN {
75+
in_frontmatter = 0
76+
frontmatter_ended = 0
77+
}
78+
# If first line is ---, we are starting frontmatter
79+
/^---$/ && NR == 1 {
80+
in_frontmatter = 1
81+
next
82+
}
83+
# If we encounter --- while in frontmatter, end it
84+
/^---$/ && in_frontmatter {
85+
in_frontmatter = 0
86+
frontmatter_ended = 1
87+
next
88+
}
89+
# Print lines only if not in frontmatter
90+
!in_frontmatter { print }
91+
' "$file" \
92+
| sed -E 's/\{#[^}]*\}//g' \
93+
| sed -E 's/<[A-Za-z0-9_]+svg[^>]*\/?>//g' \
94+
| sed -E 's/<Image[^>]*\/?>//g' \
95+
| grep -Ev '(^[[:space:]]*(slug:|<img src=\{[^}]+\})|^import .* from .*)'
7196
}
7297
# List of files to ignore
7398
IGNORE_LIST=(

0 commit comments

Comments
 (0)