Skip to content
Open
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
7 changes: 4 additions & 3 deletions ci/scripts/check_examples_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,16 @@ ROOT_DIR="$(git rev-parse --show-toplevel)"
EXAMPLES_DIR="$ROOT_DIR/datafusion-examples"
README="$EXAMPLES_DIR/README.md"
README_NEW="$EXAMPLES_DIR/README-NEW.md"
PRETTIER_VERSION="2.7.1"

echo "▶ Generating examples README (Rust generator)…"
cargo run --quiet \
--manifest-path "$EXAMPLES_DIR/Cargo.toml" \
--bin examples-docs \
> "$README_NEW"

echo "▶ Formatting generated README with Prettier…"
npx prettier@2.7.1 \
echo "▶ Formatting generated README with prettier ${PRETTIER_VERSION}…"
npx "prettier@${PRETTIER_VERSION}" \
--parser markdown \
--write "$README_NEW"

Expand All @@ -60,7 +61,7 @@ if ! diff -u "$README" "$README_NEW" > /tmp/examples-readme.diff; then
echo "To update the README locally, run:"
echo ""
echo " cargo run --bin examples-docs \\"
echo " | npx prettier@2.7.1 --parser markdown --write \\"
echo " | npx prettier@${PRETTIER_VERSION} --parser markdown --write \\"
echo " > datafusion-examples/README.md"
echo ""
echo "Diff:"
Expand Down
6 changes: 3 additions & 3 deletions dev/update_config_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ cd "${SOURCE_DIR}/../" && pwd
TARGET_FILE="docs/source/user-guide/configs.md"
PRINT_CONFIG_DOCS_COMMAND="cargo run --manifest-path datafusion/core/Cargo.toml --bin print_config_docs"
PRINT_RUNTIME_CONFIG_DOCS_COMMAND="cargo run --manifest-path datafusion/core/Cargo.toml --bin print_runtime_config_docs"

PRETTIER_VERSION="2.7.1"

echo "Inserting header"
cat <<'EOF' > "$TARGET_FILE"
Expand Down Expand Up @@ -238,7 +238,7 @@ Enables the experimental Piecewise Merge Join algorithm.
EOF


echo "Running prettier"
npx prettier@2.3.2 --write "$TARGET_FILE"
echo "Running prettier ${PRETTIER_VERSION}"
npx "prettier@${PRETTIER_VERSION}" --write "$TARGET_FILE"

echo "'$TARGET_FILE' successfully updated!"
13 changes: 7 additions & 6 deletions dev/update_function_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ cd "${SOURCE_DIR}/../" && pwd

TARGET_FILE="docs/source/user-guide/sql/aggregate_functions.md"
PRINT_AGGREGATE_FUNCTION_DOCS_COMMAND="cargo run --manifest-path datafusion/core/Cargo.toml --bin print_functions_docs -- aggregate"
PRETTIER_VERSION="2.7.1"

echo "Inserting header"
cat <<'EOF' > "$TARGET_FILE"
Expand Down Expand Up @@ -113,8 +114,8 @@ EOF
echo "Running CLI and inserting aggregate function docs table"
$PRINT_AGGREGATE_FUNCTION_DOCS_COMMAND >> "$TARGET_FILE"

echo "Running prettier"
npx prettier@2.3.2 --write "$TARGET_FILE"
echo "Running prettier ${PRETTIER_VERSION}"
npx "prettier@${PRETTIER_VERSION}" --write "$TARGET_FILE"

echo "'$TARGET_FILE' successfully updated!"

Expand Down Expand Up @@ -157,8 +158,8 @@ EOF
echo "Running CLI and inserting scalar function docs table"
$PRINT_SCALAR_FUNCTION_DOCS_COMMAND >> "$TARGET_FILE"

echo "Running prettier"
npx prettier@2.3.2 --write "$TARGET_FILE"
echo "Running prettier ${PRETTIER_VERSION}"
npx "prettier@${PRETTIER_VERSION}" --write "$TARGET_FILE"

echo "'$TARGET_FILE' successfully updated!"

Expand Down Expand Up @@ -335,7 +336,7 @@ EOF
echo "Running CLI and inserting window function docs table"
$PRINT_WINDOW_FUNCTION_DOCS_COMMAND >> "$TARGET_FILE"

echo "Running prettier"
npx prettier@2.3.2 --write "$TARGET_FILE"
echo "Running prettier ${PRETTIER_VERSION}"
npx "prettier@${PRETTIER_VERSION}" --write "$TARGET_FILE"

echo "'$TARGET_FILE' successfully updated!"