codespell.sh (2002B)
1 #!/bin/bash 2 set -euo pipefail 3 4 script_dir=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd) 5 6 skip_patterns=( 7 # Generated or vendored files and directories. 8 "*/.git/**" 9 "*/afl-tests/*" 10 "*/node_modules/**" 11 "*.pnpm-store/**" 12 "./prebuilt/**" 13 "./packages/*/lib/**" 14 "./packages/*/dist/**" 15 "**/fonts/**" 16 "**/*.map" 17 "*/i18n/strings.ts" 18 19 # Sources that intentionally contain non-English or externally defined text. 20 "./packages/taler-util/src/iso-639.ts" 21 "./packages/web-util/src/forms/gana/**" 22 "./packages/web-util/src/utils/select-ui-lists.ts" 23 "./packages/taler-merchant-webui/visual/baselines/*.aria.yml" 24 "**/doc/flows/main.de.tex" 25 "*/cbdc-es.tex" 26 "*/cbdc-it.tex" 27 "*/src/anastasis-data.ts" 28 29 # Fixtures and generated configuration. 30 "*/contrib/hellos/**" 31 "*/vpn/tests/**" 32 "**/auditor/*.sql" 33 "**/ExchangeSelection/example.ts" 34 "**/signing-key.asc" 35 "*/m4/ax_lib_postgresql.m4" 36 "*/m4/libgcrypt.m4" 37 "*/templating/test?/**" 38 "**/templating/mustach**" 39 "*/testcurl/test_tricky.c" 40 "./packages/fix-weblate-format" 41 "ABOUT-NLS" 42 "config.status" 43 44 # File formats that are generated, binary or maintained externally. 45 "*.??.json" 46 "*.PNG" 47 "*.bbl" 48 "*.bib" 49 "*.bst" 50 "*.cls" 51 "*.dat" 52 "*.deflate" 53 "*.doc" 54 "*.docx" 55 "*.ecc" 56 "*.eot" 57 "*.epgz" 58 "*.eps" 59 "*.epub" 60 "*.fee" 61 "*.fees" 62 "*.file" 63 "*.flac" 64 "*.gif" 65 "*.gz" 66 "*.ico" 67 "*.info" 68 "*.jpeg" 69 "*.jpg" 70 "*.json" 71 "*.latexmkrc" 72 "*.m4a" 73 "*.min.js" 74 "*.mp4" 75 "*.odg" 76 "*.ods" 77 "*.odt" 78 "*.pack.js" 79 "*.pdf" 80 "*.png" 81 "*.po" 82 "*.pot" 83 "*.pptx" 84 "*.priv" 85 "*.rpath" 86 "*.sqlite" 87 "*.sqlite3" 88 "*.svg" 89 "*.tag" 90 "*.tff" 91 "*.tgz" 92 "*.ttf" 93 "*.wav" 94 "*.webp" 95 "*.woff" 96 "*.woff2" 97 "*.xcf" 98 "*.xlsx" 99 "*.zip" 100 "*.zkey" 101 "*key" 102 "*/doc/texinfo.tex" 103 "**/pnpm-lock.yaml" 104 "**/rfc.bib" 105 ) 106 107 skip=$(IFS=,; echo "${skip_patterns[*]}") 108 109 cd "${script_dir}/.." 110 exec codespell \ 111 -q 0 \ 112 -I "${script_dir}/codespell-dictionary.txt" \ 113 -S "${skip}" \ 114 "$@"