Skip to content

Commit

Permalink
Exclude list from lint (#434)
Browse files Browse the repository at this point in the history
  • Loading branch information
Giom-V authored Feb 5, 2025
1 parent 31f9d8a commit 9fadfb8
Showing 1 changed file with 24 additions and 4 deletions.
28 changes: 24 additions & 4 deletions .github/workflows/notebooks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,28 @@ jobs:
# Manual run, check everything
readarray -t changed_notebooks < <(find . -name '*.ipynb' | grep -v 'gemini-2/')
fi
if [[ ${#changed_notebooks[@]} == 0 ]]; then
# Define files to exclude from linting
excluded_files=(
"examples/Object_detection.ipynb"
)
# Filter out excluded files from the changed_notebooks array
filtered_notebooks=()
for notebook in "${changed_notebooks[@]}"; do
exclude=false
for excluded_file in "${excluded_files[@]}"; do
if [[ "$notebook" == "$excluded_file" ]]; then
exclude=true
break
fi
done
if [[ "$exclude" == false ]]; then
filtered_notebooks+=("$notebook")
fi
done
if [[ ${#filtered_notebooks[@]} == 0 ]]; then
echo "No website notebooks modified in this pull request."
exit 0
else
Expand All @@ -74,6 +95,5 @@ jobs:
--exclude_lint=tensorflow::button_website \
--arg=base_url:https://ai.google.dev/ \
--exclude_lint=tensorflow::button_github \
"${changed_notebooks[@]}"
fi
"${filtered_notebooks[@]}"
fi

0 comments on commit 9fadfb8

Please sign in to comment.