Skip to content

368 further condensation #958

368 further condensation

368 further condensation #958

Workflow file for this run

name: 'spellcheck'
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
jobs:
spellcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "populate spellignore"
run: |
for file in "*.md"
do
# strip citations and references
sed -ri 's/\[@[A-Za-z0-9_  ;@-]+\]//g' $file
sed -ri 's/[^#\[][@#][A-Za-z0-9_;@-]+:[A-Za-z0-9_;@-]+}*//g' $file
sed -ri 's/@[A-Za-z0-9_]+//g' $file
# strip words that escape the spellchecker allowlist
sed -i 's/Dr.-Ing.//g; s/Ph.D.//g; s/M.Sc.//g; s/B.Sc.//g; s/Fortran//g;' $file
# latex commands
grep -P -oh -e "(?<=[\\\\\{])[A-Za-z]+" $file | sort | uniq >> .github/spellignore.txt
# RSE compositions
grep -P -oh -e "[\w-]*RSE[\w-]*" $file | sort | uniq >> .github/spellignore.txt
# remove header
sed -i '1,/---/{/^---$/,/^---$/d}' $file
done
- name: "populate spellignore with author names"
uses: mikefarah/yq@master
with:
cmd: |
yq '.authors[] | .lastName' contributors.yml | sed 's/ /\n/g; /null/d' >> .github/spellignore.txt
yq '.authors[] | .firstName' contributors.yml | sed 's/ /\n/g; /null/d' >> .github/spellignore.txt
yq '.authors[] | .suffixName' contributors.yml | sed 's/ /\n/g; /null/d' >> .github/spellignore.txt
- uses: eschercloudai/[email protected]
with:
files-to-check: "competencies.md"
files-to-exclude: "CONTRIBUTING.md\nREADME.md"
words-to-ignore-file: .github/spellignore.txt