Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions scripts/format_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,22 @@ else
exit 1
fi

# Check Jupyter Notebook format
echo "Checking Jupyter Notebook format..."
if ! command -v nbstripout &> /dev/null
then
echo "nbstripout could not be found, please install it with 'pip install nbstripout'"
exit 1
fi

for notebook in $(find . -name "*.ipynb"); do
nbstripout --check "$notebook"
if [ $? -ne 0 ]; then
echo "Notebook $notebook is not in the correct format. Please strip output and metadata."
exit 1
fi
done

echo "Checking C++ formatting...";
formatting_outputs=$(find tensorflow_quantum/ -iname *.h -o -iname *.cc | xargs clang-format -style=google -output-replacements-xml);
CFORMATCHECK=0
Expand Down
Loading