mirror of https://github.com/CrimsonTome/tldr.git
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 listpull/23/head
parent
9f69a3c857
commit
ec531b230b
|
@ -25,7 +25,7 @@ function run_black {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -z $errs ]]; then
|
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
|
if [[ $CI != true ]] && ! exists black; then
|
||||||
echo "Skipping black check, command not available."
|
echo "Skipping black check, command not available."
|
||||||
return 0
|
return 0
|
||||||
|
@ -39,7 +39,7 @@ function run_black {
|
||||||
return 0
|
return 0
|
||||||
fi
|
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
|
# do the conditional printing below
|
||||||
if [[ ${errs} != "All done!"* ]]; then
|
if [[ ${errs} != "All done!"* ]]; then
|
||||||
echo -e "${errs}" >&2
|
echo -e "${errs}" >&2
|
||||||
|
@ -48,7 +48,7 @@ function run_black {
|
||||||
}
|
}
|
||||||
|
|
||||||
function run_flake8 {
|
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
|
if [[ $CI != true ]] && ! exists flake8; then
|
||||||
echo "Skipping flake8 check, command not available."
|
echo "Skipping flake8 check, command not available."
|
||||||
return 0
|
return 0
|
||||||
|
@ -57,12 +57,16 @@ function run_flake8 {
|
||||||
flake8 scripts
|
flake8 scripts
|
||||||
}
|
}
|
||||||
|
|
||||||
# Default test function, ran by `npm test`.
|
# Default test function, run by `npm test`.
|
||||||
function run_tests {
|
function run_tests {
|
||||||
find pages* -name '*.md' -exec markdownlint {} +
|
find pages* -name '*.md' -exec markdownlint {} +
|
||||||
tldr-lint ./pages
|
tldr-lint ./pages
|
||||||
for f in ./pages.*; do
|
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
|
done
|
||||||
run_black
|
run_black
|
||||||
run_flake8
|
run_flake8
|
||||||
|
|
Loading…
Reference in New Issue