spellcheck.sh 601 B

1234567891011121314151617181920212223
  1. # Copyright (c) Meta Platforms, Inc. and affiliates.
  2. # This software may be used and distributed according to the terms of the Llama 2 Community License Agreement.
  3. # Source: https://github.com/pytorch/torchx/blob/main/scripts/spellcheck.sh
  4. set -ex
  5. sudo apt-get install aspell
  6. if [[ -z "$@" ]]; then
  7. sources=$(find -name '*.md')
  8. else
  9. sources=$@
  10. fi
  11. sources_arg=""
  12. for src in $sources; do
  13. sources_arg="${sources_arg} -S $src"
  14. done
  15. if [ ! "$sources_arg" ]; then
  16. echo "No files to spellcheck"
  17. else
  18. pyspelling -c scripts/spellcheck_conf/spellcheck.yaml --name Markdown $sources_arg
  19. fi