#!/bin/bash
set -exuo pipefail

job_dir=$(dirname "${BASH_SOURCE[0]}")

skip=$(cat <<EOF
ABOUT-NLS
configure
config.guess
configure~
*/debian/upstream/*
*/debian/.debhelper/*
*/build/*
*/contrib/gana/*
*/contrib/locale/*
*/doc/prebuilt/*
*/doc/doxygen/*
*/doc/system-documentation/*
*/doc/sphinx/_exts/*
*/doc/anastasis.texi
*/doc/manual.info
*/doc/texinfo.tex
*/doc/highlight.pack.js
*/po/*
*build-aux*
*.cache/*
*/.git/*
*/contrib/ci/*
depcomp
*libtool*
ltmain.sh
*.log
*/m4/*
*.m4
*.rpath
EOF
);

echo Current directory: `pwd`

codespell -I "${job_dir}"/dictionary.txt -S ${skip//$'\n'/,}
