Fix the ignored list of markdownlint (#14064)
Pass the arguments `--ignore=pattern1 --ignore=pattern2` instead of
`--ignore pattern1 pattern2`, which the later one isn't accepted by
`markdownlint`.
diff --git a/build_tools/scripts/run_markdownlint.sh b/build_tools/scripts/run_markdownlint.sh
index 652c7ea..cc0ce1e 100755
--- a/build_tools/scripts/run_markdownlint.sh
+++ b/build_tools/scripts/run_markdownlint.sh
@@ -20,10 +20,15 @@
)
declare -a excluded_files_patterns=(
- "/third_party/"
+ "**/third_party/**"
"**/node_modules/**"
)
-markdownlint "${included_files_patterns[*]}" \
- --config ./docs/.markdownlint.yml \
- --ignore "${excluded_files_patterns[*]}"
+# ${excluded_files_patterns} is expanded into
+# "--ignore=pattern1 --ignore=pattern2 ...", since markdownlint doesn't accept
+# "--ignore pattern1 pattern2 ...".
+# The expansion trick is explained in
+# https://stackoverflow.com/questions/20366609/prefix-and-postfix-elements-of-a-bash-array
+markdownlint "${included_files_patterns[@]}" \
+ --config=./docs/.markdownlint.yml \
+ "${excluded_files_patterns[@]/#/--ignore=}"