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() {