From ec531b230bcb0a7cb13ccb51603499bc62b969ca Mon Sep 17 00:00:00 2001 From: "K.B.Dharun Krishna" Date: Mon, 13 Nov 2023 19:52:16 +0530 Subject: [PATCH] scripts/test.sh: remove TLDR005 from ignore list for languages (#11486) * scripts/test.sh: remove TLDR005 from ignore list for languages * scripts/test.sh: ignore TLDR005 in Chinese pages * scripts/test.sh: fix indentation * scripts/test.sh: reorder ignore list --- scripts/test.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/scripts/test.sh b/scripts/test.sh index 2ab4afcbe..5edf9ee68 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -25,7 +25,7 @@ function run_black { fi if [[ -z $errs ]]; then - # skip black check if command is not available in the system. + # skip the black check if the command is not available in the system. if [[ $CI != true ]] && ! exists black; then echo "Skipping black check, command not available." return 0 @@ -39,7 +39,7 @@ function run_black { return 0 fi - # we want to ignore the exit code from black on failure, so that we can + # We want to ignore the exit code from black on failure so that we can # do the conditional printing below if [[ ${errs} != "All done!"* ]]; then echo -e "${errs}" >&2 @@ -48,7 +48,7 @@ function run_black { } function run_flake8 { - # skip flake8 check if command is not available in the system. + # skip flake8 check if the command is not available in the system. if [[ $CI != true ]] && ! exists flake8; then echo "Skipping flake8 check, command not available." return 0 @@ -57,12 +57,16 @@ function run_flake8 { flake8 scripts } -# Default test function, ran by `npm test`. +# Default test function, run by `npm test`. function run_tests { find pages* -name '*.md' -exec markdownlint {} + tldr-lint ./pages for f in ./pages.*; do - tldr-lint --ignore "TLDR003,TLDR004,TLDR005,TLDR015,TLDR104" "${f}" + if [[ $f == *zh* || $f == *zh_TW* ]]; then + tldr-lint --ignore "TLDR003,TLDR004,TLDR005,TLDR015,TLDR104" "${f}" + else + tldr-lint --ignore "TLDR003,TLDR004,TLDR015,TLDR104" "${f}" + fi done run_black run_flake8