spellcheck.sh 436 B

1234567891011121314151617181920
  1. # Source: https://github.com/pytorch/torchx/blob/main/scripts/spellcheck.sh
  2. set -ex
  3. sudo apt-get install aspell
  4. if [[ -z "$@" ]]; then
  5. sources=$(find -name '*.md')
  6. else
  7. sources=$@
  8. fi
  9. sources_arg=""
  10. for src in $sources; do
  11. sources_arg="${sources_arg} -S $src"
  12. done
  13. if [ ! "$sources_arg" ]; then
  14. echo "No files to spellcheck"
  15. else
  16. pyspelling -c scripts/spellcheck_conf/spellcheck.yaml --name Markdown $sources_arg
  17. fi