From 7bfa274864bdb6f227a58700a7d50bf41f39e2be Mon Sep 17 00:00:00 2001 From: Managor <42655600+Managor@users.noreply.github.com> Date: Tue, 23 Dec 2025 08:29:32 +0200 Subject: [PATCH] scripts/check-pr.sh: add header check (#20212) Co-authored-by: Sebastiaan Speck <12570668+sebastiaanspeck@users.noreply.github.com> --- scripts/check-pr.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/scripts/check-pr.sh b/scripts/check-pr.sh index 7e0dac84ac..cb1690519b 100755 --- a/scripts/check-pr.sh +++ b/scripts/check-pr.sh @@ -87,6 +87,13 @@ function count_commands() { grep -c "$regex" "$file" } +count_header() { + local file="$1" + local regex="$2" + + grep -c "$regex" "$file" +} + function strip_commands() { local file="$1" local regex="$2" @@ -112,6 +119,7 @@ function check_outdated_page() { local page="$1" local english_page="pages/${page#pages*\/}" local command_regex='^`[^`]\+`$' + local header_regex='^>.*$' if [[ $page == "$english_page" || ! -f $english_page ]]; then return 1 @@ -128,6 +136,12 @@ function check_outdated_page() { elif [[ "$english_commands_as_string" != "$commands_as_string" ]]; then printf "\x2d $MSG_OUTDATED" "$page" "based on the command contents itself" fi + + english_header_lines=$(count_header "$english_page" "$header_regex") + header_lines=$(count_header "$page" "$header_regex") + if [[ "$english_header_lines" != "$header_lines" ]]; then + printf "\x2d $MSG_OUTDATED" "$page" "based on number of header lines" + fi } function check_more_info_link() {