Skip to content

Instantly share code, notes, and snippets.

@adhadse
Created April 15, 2022 15:06
Show Gist options
  • Save adhadse/0068d5d2ee6c11f6c2c899d51c6de9dc to your computer and use it in GitHub Desktop.
Save adhadse/0068d5d2ee6c11f6c2c899d51c6de9dc to your computer and use it in GitHub Desktop.
#!/bin/bash -e
base_dir=$(dirname $(dirname $0))
target_dir="${base_dir}/examples/ ${base_dir}/keras_nlp/"
targets="${base_dir}/*.py ${base_dir}/examples/ ${base_dir}/keras_nlp/"
isort --sp "${base_dir}/setup.cfg" --sl ${targets}
black --line-length 80 ${targets}
for i in $(find ${target_dir} -name '*.py'); do
if ! grep -q Copyright $i; then
echo $i
cat shell/copyright.txt $i >$i.new && mv $i.new $i
fi
done
flake8 --config "${base_dir}/setup.cfg" ${targets}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment