Skip to content

Commit c9e7137

Browse files
cj-zhukovalamb
andauthored
unify the prettier versions (#20167)
## Which issue does this PR close? <!-- We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123. --> - part of ##20024. ## Rationale for this change <!-- Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed. Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes. --> ## What changes are included in this PR? <!-- There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR. --> ## Are these changes tested? <!-- We typically require tests for all PRs in order to: 1. Prevent the code from being accidentally broken by subsequent changes 2. Serve as another way to document the expected behavior of the code If tests are not included in your PR, please explain why (for example, are they covered by existing tests)? --> ## Are there any user-facing changes? <!-- If there are user-facing changes then we may require documentation to be updated before approving the PR. --> <!-- If there are any breaking changes to public APIs, please add the `api change` label. --> Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
1 parent 15eea08 commit c9e7137

3 files changed

Lines changed: 14 additions & 12 deletions

File tree

ci/scripts/check_examples_docs.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,16 @@ ROOT_DIR="$(git rev-parse --show-toplevel)"
3636
EXAMPLES_DIR="$ROOT_DIR/datafusion-examples"
3737
README="$EXAMPLES_DIR/README.md"
3838
README_NEW="$EXAMPLES_DIR/README-NEW.md"
39+
PRETTIER_VERSION="2.7.1"
3940

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

46-
echo "▶ Formatting generated README with Prettier"
47-
npx prettier@2.7.1 \
47+
echo "▶ Formatting generated README with prettier ${PRETTIER_VERSION}"
48+
npx "prettier@${PRETTIER_VERSION}" \
4849
--parser markdown \
4950
--write "$README_NEW"
5051

@@ -60,7 +61,7 @@ if ! diff -u "$README" "$README_NEW" > /tmp/examples-readme.diff; then
6061
echo "To update the README locally, run:"
6162
echo ""
6263
echo " cargo run --bin examples-docs \\"
63-
echo " | npx prettier@2.7.1 --parser markdown --write \\"
64+
echo " | npx prettier@${PRETTIER_VERSION} --parser markdown --write \\"
6465
echo " > datafusion-examples/README.md"
6566
echo ""
6667
echo "Diff:"

dev/update_config_docs.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ cd "${SOURCE_DIR}/../" && pwd
2626
TARGET_FILE="docs/source/user-guide/configs.md"
2727
PRINT_CONFIG_DOCS_COMMAND="cargo run --manifest-path datafusion/core/Cargo.toml --bin print_config_docs"
2828
PRINT_RUNTIME_CONFIG_DOCS_COMMAND="cargo run --manifest-path datafusion/core/Cargo.toml --bin print_runtime_config_docs"
29-
29+
PRETTIER_VERSION="2.7.1"
3030

3131
echo "Inserting header"
3232
cat <<'EOF' > "$TARGET_FILE"
@@ -238,7 +238,7 @@ Enables the experimental Piecewise Merge Join algorithm.
238238
EOF
239239

240240

241-
echo "Running prettier"
242-
npx prettier@2.3.2 --write "$TARGET_FILE"
241+
echo "Running prettier ${PRETTIER_VERSION}"
242+
npx "prettier@${PRETTIER_VERSION}" --write "$TARGET_FILE"
243243

244244
echo "'$TARGET_FILE' successfully updated!"

dev/update_function_docs.sh

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ cd "${SOURCE_DIR}/../" && pwd
2626

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

3031
echo "Inserting header"
3132
cat <<'EOF' > "$TARGET_FILE"
@@ -113,8 +114,8 @@ EOF
113114
echo "Running CLI and inserting aggregate function docs table"
114115
$PRINT_AGGREGATE_FUNCTION_DOCS_COMMAND >> "$TARGET_FILE"
115116

116-
echo "Running prettier"
117-
npx prettier@2.3.2 --write "$TARGET_FILE"
117+
echo "Running prettier ${PRETTIER_VERSION}"
118+
npx "prettier@${PRETTIER_VERSION}" --write "$TARGET_FILE"
118119

119120
echo "'$TARGET_FILE' successfully updated!"
120121

@@ -157,8 +158,8 @@ EOF
157158
echo "Running CLI and inserting scalar function docs table"
158159
$PRINT_SCALAR_FUNCTION_DOCS_COMMAND >> "$TARGET_FILE"
159160

160-
echo "Running prettier"
161-
npx prettier@2.3.2 --write "$TARGET_FILE"
161+
echo "Running prettier ${PRETTIER_VERSION}"
162+
npx "prettier@${PRETTIER_VERSION}" --write "$TARGET_FILE"
162163

163164
echo "'$TARGET_FILE' successfully updated!"
164165

@@ -335,7 +336,7 @@ EOF
335336
echo "Running CLI and inserting window function docs table"
336337
$PRINT_WINDOW_FUNCTION_DOCS_COMMAND >> "$TARGET_FILE"
337338

338-
echo "Running prettier"
339-
npx prettier@2.3.2 --write "$TARGET_FILE"
339+
echo "Running prettier ${PRETTIER_VERSION}"
340+
npx "prettier@${PRETTIER_VERSION}" --write "$TARGET_FILE"
340341

341342
echo "'$TARGET_FILE' successfully updated!"

0 commit comments

Comments
 (0)