From 85d4ee5c2ba6261539d753dc332bfbc637b32edf Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 21 Dec 2025 14:28:30 -0600 Subject: [PATCH] make validate-urls --- Makefile | 14 ++++++++++---- Marlin/src/HAL/LPC1768/HAL_SPI.cpp | 4 ---- Marlin/src/pins/ramps/pins_DUPLICATOR_I3_PLUS.h | 2 +- buildroot/share/{scripts => make}/check-urls.sh | 5 +++-- buildroot/share/{scripts => make}/find.py | 0 .../share/{scripts => make}/get_test_targets.py | 0 .../share/{scripts => make}/validate_boards.py | 0 7 files changed, 14 insertions(+), 11 deletions(-) rename buildroot/share/{scripts => make}/check-urls.sh (93%) rename buildroot/share/{scripts => make}/find.py (100%) rename buildroot/share/{scripts => make}/get_test_targets.py (100%) rename buildroot/share/{scripts => make}/validate_boards.py (100%) diff --git a/Makefile b/Makefile index 768674f294..f8a9ae3c4e 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 @@ -9,7 +10,7 @@ ifeq ($(OS),Windows_NT) # Windows: use `where` – fall back through the three common names PYTHON := $(shell which python 2>nul || which python3 2>nul || which py 2>nul) # Windows: Use Python script to find pins files - PINS := $(shell $(PYTHON) $(SCRIPTS_DIR)/find.py Marlin/src/pins -mindepth 2 -name 'pins_*.h') + PINS := $(shell $(PYTHON) $(MAKESCRIPTS_DIR)/find.py Marlin/src/pins -mindepth 2 -name 'pins_*.h') else # POSIX: use `command -v` – prefer python3 over python PYTHON := $(shell command -v python3 2>/dev/null || command -v python 2>/dev/null) @@ -35,6 +36,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" @@ -87,7 +89,7 @@ tests-all-local: @$(PYTHON) -c "import yaml" 2>/dev/null || (echo 'pyyaml module is not installed. Install it with "$(PYTHON) -m pip install pyyaml"' && exit 1) export PATH="./buildroot/bin/:./buildroot/tests/:${PATH}" \ && export VERBOSE_PLATFORMIO=$(VERBOSE_PLATFORMIO) \ - && for TEST_TARGET in $$($(PYTHON) $(SCRIPTS_DIR)/get_test_targets.py) ; do \ + && for TEST_TARGET in $$($(PYTHON) $(MAKESCRIPTS_DIR)/get_test_targets.py) ; do \ if [ "$$TEST_TARGET" = "linux_native" ] && [ "$$(uname)" = "Darwin" ]; then \ echo "Skipping tests for $$TEST_TARGET on macOS" ; \ continue ; \ @@ -150,7 +152,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" @@ -161,10 +163,14 @@ 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 validate-boards: @echo "Validating boards.h file" - @$(PYTHON) $(SCRIPTS_DIR)/validate_boards.py $(BOARDS_FILE) || (echo "\nError: boards.h file is not valid. Please check and correct it.\n" && exit 1) + @$(PYTHON) $(MAKESCRIPTS_DIR)/validate_boards.py $(BOARDS_FILE) || (echo "\nError: boards.h file is not valid. Please check and correct it.\n" && exit 1) 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/Marlin/src/pins/ramps/pins_DUPLICATOR_I3_PLUS.h b/Marlin/src/pins/ramps/pins_DUPLICATOR_I3_PLUS.h index 40351d2bde..edac07fdd1 100644 --- a/Marlin/src/pins/ramps/pins_DUPLICATOR_I3_PLUS.h +++ b/Marlin/src/pins/ramps/pins_DUPLICATOR_I3_PLUS.h @@ -181,5 +181,5 @@ * ################################## * * Pictogram by Ludy https://github.com/Ludy87 - * See: https://sebastien.andrivet.com/en/posts/wanhao-duplicator-i3-plus-3d-printer/ + * See: https://sebastien.andrivet.com/en/posts/wanhao-duplicator-i3-plus-3d-printers/ */ diff --git a/buildroot/share/scripts/check-urls.sh b/buildroot/share/make/check-urls.sh similarity index 93% rename from buildroot/share/scripts/check-urls.sh rename to buildroot/share/make/check-urls.sh index 5e90b8f433..7d9c0ad326 100755 --- a/buildroot/share/scripts/check-urls.sh +++ b/buildroot/share/make/check-urls.sh @@ -8,7 +8,7 @@ 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 . -type f ! -path "*/\.*" -exec grep -Eo "https?:\/\/[^ \"''$$\<\>]+" {} \; 2>/dev/null \ | grep -v "Binary file" \ | sed -E "s/\/https?:\/\//\//" \ | sed -E 's/.*\((https?:\/\/[^ ]+)\).*$/\1/' \ @@ -30,7 +30,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 +47,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 diff --git a/buildroot/share/scripts/find.py b/buildroot/share/make/find.py similarity index 100% rename from buildroot/share/scripts/find.py rename to buildroot/share/make/find.py diff --git a/buildroot/share/scripts/get_test_targets.py b/buildroot/share/make/get_test_targets.py similarity index 100% rename from buildroot/share/scripts/get_test_targets.py rename to buildroot/share/make/get_test_targets.py diff --git a/buildroot/share/scripts/validate_boards.py b/buildroot/share/make/validate_boards.py similarity index 100% rename from buildroot/share/scripts/validate_boards.py rename to buildroot/share/make/validate_boards.py