From d504fce355f00de720b85e4b8e4d8cd3e5669330 Mon Sep 17 00:00:00 2001 From: Ziheng Sun Date: Mon, 5 Feb 2024 00:50:18 -0500 Subject: [PATCH] Update reproducibility-checker.yml --- .github/workflows/reproducibility-checker.yml | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/.github/workflows/reproducibility-checker.yml b/.github/workflows/reproducibility-checker.yml index 28a1a36..5024f13 100644 --- a/.github/workflows/reproducibility-checker.yml +++ b/.github/workflows/reproducibility-checker.yml @@ -15,8 +15,20 @@ jobs: - uses: ./.github/actions/setupconda - - name: Install packages for the checker script - run: pip install nbformat + - name: Install Dependencies + run: | + pip install nbqa flake8 - - name: Run Python Script - run: python ./.github/workflows/reproducibility_checker.py + - name: Lint Jupyter Notebooks + run: | + find ./book/chapters/ -type f -name '*.ipynb' -exec nbqa flake8 {} + + + # Fail the workflow if linting errors are found + continue-on-error: true + + - name: Check for Errors + run: | + if [ -n "$(grep -r "^[^:]*: [1-9]" ./*.ipynb)" ]; then + echo "Linting errors found. Please check the logs." + exit 1 + fi