Commit 7456a7ba authored by Eva Zangerle's avatar Eva Zangerle
Browse files

improved shell script reg. usability

parent 0f7bbccc
cd notebooks #!/bin/bash
py.test --nbval $1
nbqa isort $1 # script takes a Jupyter Notebook as argument and calls
nbqa black --line-length=79 $1 # validation and static code analysis tools for this notebook
nbqa flake8 $1
# usage help
usage() {
echo "Usage: $0 NOTEBOOK_TO_CHECK.ipynb" 1>&2
}
# call tools for given notebook
perform_qa() {
py.test --nbval $1
nbqa isort $1
nbqa black --line-length=79 $1
nbqa flake8 $1
}
# check if command line argument is present
if [ "$#" -ne 1 ]; then
echo "No notebook (.ipynb) was provided";
usage;
exit 1;
fi
perform_qa $1
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment