Skip to content

Commit bb0792b

Browse files
authored
chore(docs): stop readthedocs spellcheck (#15679)
## Description ReadTheDocs environments don't set `READTHEDOCS=True` as expected. Update the build script to accept `READTHEDOCS=1` (as set in `.readthedocs.yml`) and normalize the value (case-insensitive, strip whitespace) to match both `"true"` and `"1"`. ## Testing Tested with `"True"`, `"TRUE"`, `"true"`, `"1"`, and `" true "`, all correctly match. Empty, `"False"`, and `"0"` correctly do not match. ## Additional Notes Failing job: https://app.readthedocs.org/projects/ddtrace/builds/30721096/
1 parent e928462 commit bb0792b

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

.readthedocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ build:
88
- cargo install --force --root /home/docs/.asdf --git https://github.com/DataDog/libdatadog --bin dedup_headers tools
99
- git fetch --unshallow || true
1010
- pip install riot
11-
- riot -v run --pass-env build_docs
11+
- READTHEDOCS=1 riot -v run --pass-env build_docs
1212
- mv docs/_build $READTHEDOCS_OUTPUT

scripts/docs/build.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#!/usr/bin/env bash
22
set -eux
33

4-
if [[ "${READTHEDOCS:-}" = "True" ]]; then
4+
# Normalize READTHEDOCS: lowercase and strip whitespace to match "true" or "1"
5+
rtd_val="${READTHEDOCS:-}"; rtd_val="${rtd_val,,}"; rtd_val="${rtd_val// /}"
6+
if [[ "$rtd_val" == "true" || "$rtd_val" == "1" ]]; then
57
echo "Skipping spelling check in RTD"
68
else
79
if [[ "$(uname)" == "Darwin" ]]; then

0 commit comments

Comments
 (0)