Skip to content
Draft
Changes from 1 commit
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
Next Next commit
ENH: only run diffed content
  • Loading branch information
bsipocz committed May 21, 2025
commit aacfb2bc2e52d681007d35df1d055d63e9cd9ccb
11 changes: 9 additions & 2 deletions test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,17 @@ notebook_files=()

# Find Markdown files convert.
all_markdown_files=$(find tutorials -type f -name "*.md")

if [ $# -gt 0 ]; then
files_to_process="$@"
if [[ "$1" == all ]]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if [[ "$1" == all ]]; then
if [[ "$1" == --all ]]; then

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe make --all the default because it requires no further input for the user.

files_to_process=$all_markdown_files
else
files_to_process="$@"
fi

else
files_to_process=$all_markdown_files
# We only want to run tests for the notebooks we touched
files_to_process=$(git fetch origin main --depth=1; git diff origin/main --name-only tutorials | grep .md)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the usage is --changed <branch> we can avoid hard-coding a specific branch name.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good, and the we can hard-code origin and main on CI as those are set up there.

fi

# Identify Markdown files that are Jupytext and convert them all.
Expand Down