-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ci): adds grammar and spell checking for code/content tests (#701)
closes #694 Currently spell checking runs on code and content `wget` from STG. This feature needs to be further built out to run in workflow automation. Creating #700 for this.
- Loading branch information
Showing
7 changed files
with
3,312 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"api_url": "https://api.languagetool.org/v2/check", | ||
"api_key": "", | ||
"dictionary": [], | ||
"language": "en-US", | ||
"rules": { | ||
"casing": true, | ||
"colloquialisms": true, | ||
"compounding": true, | ||
"confused_words": true, | ||
"false_friends": true, | ||
"gender_neutrality": true, | ||
"grammar": true, | ||
"misc": true, | ||
"punctuation": true, | ||
"redundancy": true, | ||
"regionalisms": true, | ||
"repetitions": true, | ||
"semantics": true, | ||
"style": true, | ||
"typography": true, | ||
"typos": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
|
||
# Checks final build spelling | ||
|
||
SITEMAP="${1:-https://stg.dgrebb.com/sitemap.xml}" | ||
urls=$(curl -s $SITEMAP | grep "<loc>" | awk -F"<loc>" '{print $2} ' | awk -F"</loc>" '{print $1}') | ||
for url in $urls; do | ||
echo "$url" | ||
content=$(wget $url -q -O - | npm run text -- -p machine --selectors[] {} :selector=img :format=skip) | ||
echo $content | npm run spell -- stdin://$url | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"dictionaryDefinitions": [ | ||
{ | ||
"name": "dgWords", | ||
"path": "./dict.txt", | ||
"addWords": true | ||
} | ||
], | ||
"dictionaries": ["dgWords"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
dgrebb | ||
subdir | ||
strapi | ||
cmsdomain | ||
FARGATE | ||
jsonencode | ||
awsvpc | ||
awslogs | ||
regexall | ||
fqdns | ||
basedomain | ||
reportsdomain | ||
cdndomain | ||
etag | ||
filemd | ||
wonka | ||
notfound | ||
navbrand | ||
blistre | ||
psxl | ||
psbl | ||
Csvg | ||
Crect | ||
subactive | ||
pubdate | ||
extralight | ||
hljs | ||
doctag | ||
themeset | ||
pinboard | ||
Grebb | ||
beareth | ||
fullname | ||
obtaineth | ||
pageviews | ||
ohhhhh | ||
ongoingly | ||
Strapi | ||
Commeth | ||
developeth | ||
shineth | ||
Speaketh | ||
runneth | ||
navigateth | ||
provideth | ||
Ensureth |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
bluebg="\e[44m" | ||
green="32" | ||
red="31" | ||
yellow="33" | ||
BR="\e[${red}m" | ||
BG="\e[1;${green}m" | ||
BY="\e[1;${yellow}m" | ||
NC="\033[0m" # No Color | ||
|
||
# Checks final build spelling | ||
|
||
SITEMAP="${1:-https://stg.dgrebb.com/sitemap.xml}" | ||
urls=$(curl -s $SITEMAP | grep "<loc>" | awk -F"<loc>" '{print $2} ' | awk -F"</loc>" '{print $1}') | ||
for url in $urls; do | ||
echo | ||
echo "==================================================" | ||
echo | ||
echo "📖 Reading $url..." | ||
content=$(wget $url -q -O - | npm run text -- -p human --selectors[] {} :selector=img :format=skip) >/dev/null | ||
spelling=$(echo $content | npm run -s spell.web.list -- stdin://$url --quiet) | ||
grammar=$(echo "$content" | npm run grammar) | ||
echo | ||
# sp=$(printf "${BG}✓ All spelling correct!${NC}") | ||
# if [[ $spelling ]]; then sp=$(printf "${BY}%s\n\n${NC}${BR}%s${NC}" "Spelling errors found!" "$spelling"); fi | ||
# echo -e "$sp" | ||
# gr=$(printf "${BG}✓ All grammar correct!${NC}") | ||
# if [[ $grammar ]]; then sp=$(printf "${BY}%s\n\n${NC}${BR}%s${NC}" "Grammar issues found!" "$grammar"); fi | ||
# echo -e "$gr" | ||
echo $grammar | ||
done |
Oops, something went wrong.