Update
[less_retarded_wiki.git] / check.sh
blobe15ceb3c2824213c17c5d9c31fa83c188a54b8d6
1 #!/bin/sh
2 # Checks for potential errors in articles.
4 echo "===== trailing spaces:"
5 grep -rno " \+$" *.md
7 echo "===== links not ending in .md:"
8 grep -rno "\[[^]]*\]([^)]*\([^.)][^)][^)]\|[^)][^m)][^)]\|[^)][^)][^d)]\))" *.md
10 typos="("
11 typos="${typos}pubic|noticabl|occassion|ocassion|occure|occurres|adress"
12 typos="${typos}agressi|aggresi|aparrent|apparrent|concensu|definat|dissapoint|"
13 typos="${typos}dissappoint|disasterous|lmoa|cathegor|comming|commited|comitted"
14 typos="${typos}embarass|embarrasi|excede|harrass|harrase|fullfil|immitat|"
15 typos="${typos}taht|lightening|milleni|milenni|miniscule|mispell|neccessar|"
16 typos="${typos}necces|occasionaly|occurrance|occurence|passtime|posess|"
17 typos="${typos}possese|preceed|priviledge|reccom|refered|succesful|sucessful|"
18 typos="${typos}errorne|erorrne|superced|tommor|vaccu|wierd|wellfare|acknoleg"
19 typos="${typos}aparrent|collegue|deppres"
20 typos="${typos})"
22 echo "===== common typos:"
23 grep -rnoEi $typos *.md
25 echo "===== bad first headings:"
26 for f in *.md; do
27 secondChar=`grep -m 1 "^#.*" $f | head -c 2 | tail -c 1`
29 if [ "$secondChar" = "#" ]; then
30 echo $f
32 done