diff --git a/scripts/check-pr.sh b/scripts/check-pr.sh index 70efc012e1..a9c82c1ce3 100755 --- a/scripts/check-pr.sh +++ b/scripts/check-pr.sh @@ -121,6 +121,16 @@ function check_more_info_link() { fi } +function check_page_title() { + local page=$1 + + grep "$page" "page-titles.txt" > /dev/null + + if [ $? -eq 0 ]; then + printf "\x2d $MSG_PAGE_TITLE" "$page" + fi +} + # Look at git diff and check for copied/duplicated pages. function check_diff { local git_diff @@ -137,6 +147,7 @@ function check_diff { fi python3 scripts/set-more-info-link.py -Sn > more-info-links.txt + python3 scripts/set-page-title.py -Sn > page-titles.txt while read line; do readarray -td$'\t' entry < <(echo -n "$line") @@ -159,11 +170,13 @@ function check_diff { check_missing_english_page "$file1" check_outdated_page "$file1" check_more_info_link "$file1" + check_page_title "$file1" ;; M) # file1 was modified check_missing_english_page "$file1" check_outdated_page "$file1" check_more_info_link "$file1" + check_page_title "$file1" ;; esac done <<< "$git_diff" @@ -198,6 +211,7 @@ MSG_NOT_DIR='The file `%s` does not look like a directory.\n' MSG_NOT_FILE='The file `%s` does not look like a regular file.\n' MSG_NOT_MD='The file `%s` does not have a `.md` extension.\n' MSG_MORE_INFO='The page `%s` has an outdated more info link.\n' +MSG_PAGE_TITLE='The page `%s` has an outdated page title.\n' PLATFORMS=$(ls pages/)