mirror of
https://github.com/MarlinFirmware/Marlin.git
synced 2026-01-18 05:45:33 -07:00
🧑💻 Make action to Check URLs
This commit is contained in:
parent
8d54de83d3
commit
c346b07b91
3 changed files with 12 additions and 8 deletions
8
Makefile
8
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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
Loading…
Add table
Add a link
Reference in a new issue