Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding an exclude list from lint #434

Merged
merged 1 commit into from
Feb 5, 2025
Merged
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
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