Skip to content

Commit 80485d7

Browse files
authored
unify the prettier version adv(#20024) (#20311)
## 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. --> - Closes ##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. -->
1 parent e9bcfb4 commit 80485d7

5 files changed

Lines changed: 44 additions & 13 deletions

File tree

ci/scripts/check_examples_docs.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,13 @@
3333
set -euo pipefail
3434

3535
ROOT_DIR="$(git rev-parse --show-toplevel)"
36+
37+
# Load centralized tool versions
38+
source "${ROOT_DIR}/ci/scripts/utils/tool_versions.sh"
39+
3640
EXAMPLES_DIR="$ROOT_DIR/datafusion-examples"
3741
README="$EXAMPLES_DIR/README.md"
3842
README_NEW="$EXAMPLES_DIR/README-NEW.md"
39-
PRETTIER_VERSION="2.7.1"
4043

4144
echo "▶ Generating examples README (Rust generator)…"
4245
cargo run --quiet \

ci/scripts/doc_prettier_check.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,20 @@
1919

2020
set -euo pipefail
2121

22-
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
22+
ROOT_DIR="$(git rev-parse --show-toplevel)"
2323
SCRIPT_NAME="$(basename "${BASH_SOURCE[0]}")"
24-
PRETTIER_VERSION="2.7.1"
24+
25+
# Load shared utilities and tool versions
26+
source "${ROOT_DIR}/ci/scripts/utils/tool_versions.sh"
27+
source "${ROOT_DIR}/ci/scripts/utils/git.sh"
28+
2529
PRETTIER_TARGETS=(
2630
'{datafusion,datafusion-cli,datafusion-examples,dev,docs}/**/*.md'
2731
'!datafusion/CHANGELOG.md'
2832
README.md
2933
CONTRIBUTING.md
3034
)
3135

32-
source "${SCRIPT_DIR}/utils/git.sh"
33-
3436
MODE="check"
3537
ALLOW_DIRTY=0
3638

ci/scripts/utils/tool_versions.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Licensed to the Apache Software Foundation (ASF) under one
4+
# or more contributor license agreements. See the NOTICE file
5+
# distributed with this work for additional information
6+
# regarding copyright ownership. The ASF licenses this file
7+
# to you under the Apache License, Version 2.0 (the
8+
# "License"); you may not use this file except in compliance
9+
# with the License. You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing,
14+
# software distributed under the License is distributed on an
15+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
# KIND, either express or implied. See the License for the
17+
# specific language governing permissions and limitations
18+
# under the License.
19+
20+
# This file defines centralized tool versions used by CI and development scripts.
21+
# It is intended to be sourced by other scripts and should not be executed directly.
22+
23+
PRETTIER_VERSION="2.7.1"

dev/update_config_docs.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
#
33
# Licensed to the Apache Software Foundation (ASF) under one
44
# or more contributor license agreements. See the NOTICE file
@@ -20,13 +20,15 @@
2020

2121
set -e
2222

23-
SOURCE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
24-
cd "${SOURCE_DIR}/../" && pwd
23+
ROOT_DIR="$(git rev-parse --show-toplevel)"
24+
cd "${ROOT_DIR}"
25+
26+
# Load centralized tool versions
27+
source "${ROOT_DIR}/ci/scripts/utils/tool_versions.sh"
2528

2629
TARGET_FILE="docs/source/user-guide/configs.md"
2730
PRINT_CONFIG_DOCS_COMMAND="cargo run --manifest-path datafusion/core/Cargo.toml --bin print_config_docs"
2831
PRINT_RUNTIME_CONFIG_DOCS_COMMAND="cargo run --manifest-path datafusion/core/Cargo.toml --bin print_runtime_config_docs"
29-
PRETTIER_VERSION="2.7.1"
3032

3133
echo "Inserting header"
3234
cat <<'EOF' > "$TARGET_FILE"

dev/update_function_docs.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
#
33
# Licensed to the Apache Software Foundation (ASF) under one
44
# or more contributor license agreements. See the NOTICE file
@@ -20,13 +20,14 @@
2020

2121
set -e
2222

23-
SOURCE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
24-
cd "${SOURCE_DIR}/../" && pwd
23+
ROOT_DIR="$(git rev-parse --show-toplevel)"
24+
cd "${ROOT_DIR}"
2525

26+
# Load centralized tool versions
27+
source "${ROOT_DIR}/ci/scripts/utils/tool_versions.sh"
2628

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

3132
echo "Inserting header"
3233
cat <<'EOF' > "$TARGET_FILE"

0 commit comments

Comments
 (0)