From c346b07b91c81d71d4cf93649b760cf181f3336a Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 21 Dec 2025 17:43:45 -0600 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Make=20acti?= =?UTF-8?q?on=20to=20Check=20URLs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 8 +++++++- Marlin/src/HAL/LPC1768/HAL_SPI.cpp | 4 ---- buildroot/share/{scripts => make}/check-urls.sh | 8 +++++--- 3 files changed, 12 insertions(+), 8 deletions(-) rename buildroot/share/{scripts => make}/check-urls.sh (89%) diff --git a/Makefile b/Makefile index 68c522e5b6..4e35047896 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,5 @@ SCRIPTS_DIR := buildroot/share/scripts +MAKESCRIPTS_DIR := buildroot/share/make CONTAINER_RT_BIN := docker CONTAINER_RT_OPTS := --rm -v $(PWD):/code -v platformio-cache:/root/.platformio CONTAINER_IMAGE := marlin-dev @@ -36,6 +37,7 @@ help: @echo "make validate-lines -j : Validate line endings, fails on trailing whitespace, etc." @echo "make validate-pins -j : Validate all pins files, fails if any require reformatting" @echo "make validate-boards -j : Validate boards.h and pins.h for standards compliance" + @echo "make validate-urls : Validate URLs in source files" @echo "make tests-single-ci : Run a single test from inside the CI" @echo "make tests-single-local : Run a single test locally" @echo "make tests-single-local-docker : Run a single test locally, using docker" @@ -151,7 +153,7 @@ validate-pins: format-pins @echo "Validating pins files" @git diff --exit-code || (git status && echo "\nError: Pins files are not formatted correctly. Run \"make format-pins\" to fix.\n" && exit 1) -.PHONY: format-lines validate-lines +.PHONY: format-lines validate-lines validate-urls format-lines: @echo "Formatting all sources" @@ -162,6 +164,10 @@ validate-lines: @echo "Validating text formatting" @npx prettier --check . --editorconfig --object-wrap preserve +validate-urls: + @echo "Checking URLs in source files" + @$(MAKESCRIPTS_DIR)/check-urls.sh + BOARDS_FILE := Marlin/src/core/boards.h .PHONY: validate-boards diff --git a/Marlin/src/HAL/LPC1768/HAL_SPI.cpp b/Marlin/src/HAL/LPC1768/HAL_SPI.cpp index 6ce7f75552..15ace81dc2 100644 --- a/Marlin/src/HAL/LPC1768/HAL_SPI.cpp +++ b/Marlin/src/HAL/LPC1768/HAL_SPI.cpp @@ -40,10 +40,6 @@ * SPI sharing pins. The SCK, MOSI & MISO pins can NOT be set/cleared with * WRITE nor digitalWrite when the hardware SPI module within the LPC17xx is * active. If any of these pins are shared then the software SPI must be used. - * - * A more sophisticated hardware SPI can be found at the following link. - * This implementation has not been fully debugged. - * https://github.com/MarlinFirmware/Marlin/tree/071c7a78f27078fd4aee9a3ef365fcf5e143531e */ #ifdef TARGET_LPC1768 diff --git a/buildroot/share/scripts/check-urls.sh b/buildroot/share/make/check-urls.sh similarity index 89% rename from buildroot/share/scripts/check-urls.sh rename to buildroot/share/make/check-urls.sh index 5e90b8f433..098a9edea9 100755 --- a/buildroot/share/scripts/check-urls.sh +++ b/buildroot/share/make/check-urls.sh @@ -8,8 +8,10 @@ UA="Mozilla/5.0 (Linux; Android 10; SM-G996U Build/QP1A.190711.020; wv) AppleWeb UTMP=$(mktemp) #echo "[debug 1] UTMP = ${UTMP}" echo "Gathering URLs. Please wait..." -grep -R -E "https?:\/\/[^ \"''\(\)\<\>]+" . 2>/dev/null \ +find Marlin/src -type f ! -path "*/\.*" -exec grep -Eo "https?:\/\/[^ \"'\$\<\>]+" {} \; 2>/dev/null \ + | sort -u -R \ | grep -v "Binary file" \ + | grep -v "/licenses" | grep -v "MarlinFirmware/Marlin" | grep -v "st.com/resource" \ | sed -E "s/\/https?:\/\//\//" \ | sed -E 's/.*\((https?:\/\/[^ ]+)\).*$/\1/' \ | sed -E 's/.*\[(https?:\/\/[^ ]+)\].*$/\1/' \ @@ -17,7 +19,6 @@ grep -R -E "https?:\/\/[^ \"''\(\)\<\>]+" . 2>/dev/null \ | grep -vE "(127\.0\.0\.1|localhost|myserver|doc\.qt\.io|docs\.google\.com|raw\.githubusercontent\.com|[\${}])" \ | sed -E 's/]$//' | sed -E "s/'$//" | sed -E "s/[#.',]+$//" \ | sed -E 's/youtu\.be\/(.+)/www.youtube.com\/watch?v=\1/' \ - | sort -u -R \ >"$UTMP" #echo "[debug 2] link count = $(wc -l $UTMP)" @@ -30,7 +31,7 @@ grep -R -E "https?:\/\/[^ \"''\(\)\<\>]+" . 2>/dev/null \ if [[ $HERR > 0 ]]; then # Error 92 may be domain blocking curl / wget [[ $HERR == 92 ]] || { ISERR=1 ; BADURLS+=($URL) ; } - echo "[FAIL ($HERR)]" + echo "${URL} ... [FAIL ($HERR)]" else HEAD1=$(echo $HEAD | head -n1) EMSG= @@ -47,6 +48,7 @@ grep -R -E "https?:\/\/[^ \"''\(\)\<\>]+" . 2>/dev/null \ *) EMSG="[Other Err]" ;; esac if [[ -n $EMSG ]]; then + echo -n "${URL} ... " if [[ -n $WHERE ]]; then [[ ${HEAD,,} =~ "location: " ]] && EMSG+=" to $(echo "$HEAD" | grep -i "location: " | sed -E 's/location: (.*)/\1/')" else