Skip to content
Merged
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
Empty file modified ci/scripts/markdown_link_check.sh
100644 → 100755
Empty file.
10 changes: 9 additions & 1 deletion dev/rust_lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
#
# Note: The installed checking tools (e.g., taplo) are not guaranteed to match
# the CI versions for simplicity, there might be some minor differences. Check
# `.github/workflows` for the CI versions.
# `.github/workflows` for the CI versions. When this script installs a missing
# tool that has a pinned version in `ci/scripts/utils/tool_versions.sh`, it
# installs that pinned version. An already installed tool is used as is.
#
#
#
Expand Down Expand Up @@ -84,10 +86,15 @@ while [[ $# -gt 0 ]]; do
done

SCRIPT_NAME="$(basename "${BASH_SOURCE[0]}")"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

# Load the tool versions shared with CI (for example, LYCHEE_VERSION).
source "${SCRIPT_DIR}/../ci/scripts/utils/tool_versions.sh"

ensure_tool "taplo" "cargo install taplo-cli --locked"
ensure_tool "hawkeye" "cargo install hawkeye --locked"
ensure_tool "typos" "cargo install typos-cli --locked"
ensure_tool "lychee" "cargo install lychee --locked --version ${LYCHEE_VERSION}"

run_step() {
local name="$1"
Expand All @@ -107,6 +114,7 @@ declare -a WRITE_STEPS=(

declare -a READONLY_STEPS=(
"ci/scripts/check_no_cargo_install_in_workflows.sh|false"
"ci/scripts/markdown_link_check.sh|false"
"ci/scripts/rust_docs.sh|false"
)

Expand Down
8 changes: 7 additions & 1 deletion docs/source/contributor-guide/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,12 @@ tested in the same way using the [doc_comment] crate. See the end of

## Documentation Link Checks

Run the internal markdown link check locally:
`./dev/rust_lint.sh` runs the internal markdown link check. If `lychee` is
missing, the script installs the version pinned in
`ci/scripts/utils/tool_versions.sh`. It uses an existing installation as is,
even if the version differs from the pin.

To run the check on its own:

```shell
source ci/scripts/utils/tool_versions.sh
Expand All @@ -200,6 +205,7 @@ Notes:

- The script is run with `bash` and is compatible with the default Bash on macOS (no `mapfile` dependency).
- The CI configuration currently checks internal markdown links only. External `http(s)` and `mailto` links are excluded to avoid flaky failures.
- The check only reports broken links. `./dev/rust_lint.sh --write` does not change them.

When a link is broken, lychee prints the file and URL/path that failed. For example:

Expand Down