Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .github/workflows/claude-model-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
pull_request:
types: [opened, synchronize]
paths:
- 'skills/**/*.ipynb'
- '**/*.ipynb'
- '**.py'
- '**.md'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/claude-notebook-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
pull_request:
types: [opened, synchronize]
paths:
- 'skills/**/*.ipynb'
- '**/*.ipynb'
- 'pyproject.toml'
- 'uv.lock'
- 'scripts/**/*.py'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
pip install jupyter nbconvert
mkdir -p temp_md

for nb in skills/**/*.ipynb; do
for nb in $(find . -name "*.ipynb" -not -path "*/.*"); do
echo "Converting: $nb"
jupyter nbconvert --to markdown "$nb" \
--output-dir=temp_md \
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/notebook-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ name: Notebook Quality Check
on:
pull_request:
paths:
- 'skills/**/*.ipynb'
- '**/*.ipynb'
- 'pyproject.toml'
- 'uv.lock'
push:
branches: [main]
paths:
- 'skills/**/*.ipynb'
- '**/*.ipynb'

permissions:
contents: read
Expand Down Expand Up @@ -37,8 +37,8 @@ jobs:

- name: Lint notebooks with Ruff
run: |
uv run ruff check skills/**/*.ipynb --show-fixes || true
uv run ruff format skills/**/*.ipynb --check || true
uv run ruff check **/*.ipynb --show-fixes || true
uv run ruff format **/*.ipynb --check || true

- name: Validate notebook structure
run: |
Expand All @@ -54,9 +54,9 @@ jobs:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
run: |
mkdir -p test_outputs
for notebook in skills/*/guide.ipynb; do
for notebook in $(find . -name "*.ipynb" -not -path "*/.*" -not -path "*/test_outputs/*"); do
echo "📓 Testing: $notebook"
output_name=$(basename $(dirname "$notebook"))
output_name=$(echo "$notebook" | sed 's|/|_|g' | sed 's|\.|_|g')
# Use nbconvert to execute notebooks and save outputs
uv run jupyter nbconvert --to notebook \
--execute "$notebook" \
Expand All @@ -75,8 +75,8 @@ jobs:
github.event.pull_request.author_association != 'OWNER'
run: |
echo "🔒 Running in mock mode for external contributor"
for notebook in skills/*/guide.ipynb; do

for notebook in $(find . -name "*.ipynb" -not -path "*/.*"); do
echo "📓 Validating structure: $notebook"
uv run python -m nbformat.validator "$notebook"
done
Expand Down
20 changes: 15 additions & 5 deletions scripts/validate_notebooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,30 @@ def validate_notebook(path: Path) -> list:
def main():
"""Check all notebooks."""
has_issues = False

for notebook in Path('skills').glob('**/*.ipynb'):

# Find all notebooks in the repository
notebooks = list(Path('.').glob('**/*.ipynb'))
# Exclude hidden directories and common build directories
notebooks = [nb for nb in notebooks if not any(part.startswith('.') for part in nb.parts)]
notebooks = [nb for nb in notebooks if 'test_outputs' not in nb.parts]

if not notebooks:
print("⚠️ No notebooks found to validate")
sys.exit(0)

for notebook in notebooks:
issues = validate_notebook(notebook)
if issues:
has_issues = True
print(f"\n❌ {notebook}:")
for issue in issues:
print(f" - {issue}")

if not has_issues:
print("✅ All notebooks validated successfully")
print(f"✅ All {len(notebooks)} notebooks validated successfully")
else:
print("\n⚠️ Found issues that should be fixed in a separate PR")

# For POC, return 0 even with issues to show detection without blocking
sys.exit(0)

Expand Down
Loading