support ignoring files when check the spelling

Signed-off-by: yuswift <yuswift2018@gmail.com>
This commit is contained in:
yuswift
2021-07-15 20:07:04 +08:00
parent 7318b18c03
commit 919995fe3b
2 changed files with 19 additions and 4 deletions
+10
View File
@@ -0,0 +1,10 @@
content/en/blog/_posts/2016-05-00-Coreosfest2016-Kubernetes-Community.md
content/en/blog/_posts/2016-10-00-Dynamic-Provisioning-And-Storage-In-Kubernetes.md
content/en/blog/_posts/2017-02-00-Postgresql-Clusters-Kubernetes-Statefulsets.md
content/en/blog/_posts/2018-06-28-Airflow-Kubernetes-Operator.md
content/en/blog/_posts/2018-10-02-network-bootable-farm-with-ltsp.md
content/en/blog/_posts/2019-03-19-kubeedge-k8s-based-edge-intro.md
content/en/blog/_posts/2020-05-06-third-party-dual-sourced-content.md
content/en/blog/_posts/2020-05-21-wsl2-dockerdesktop-k8s.md
content/en/blog/_posts/2020-07-27-kubernetes-1-17-release-interview.md
+6 -1
View File
@@ -34,6 +34,9 @@ set -o pipefail
TOOL_VERSION="v0.3.4" TOOL_VERSION="v0.3.4"
KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
export KUBE_ROOT
LANGUAGE="${1:-en}" LANGUAGE="${1:-en}"
# cd to the root path # cd to the root path
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)" ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)"
@@ -60,7 +63,9 @@ cd "${ROOT}"
RES=0 RES=0
echo "Checking spelling..." echo "Checking spelling..."
ERROR_LOG="${TMP_DIR}/errors.log" ERROR_LOG="${TMP_DIR}/errors.log"
git ls-files | grep content/${LANGUAGE} | xargs misspell > "${ERROR_LOG}" skipping_file="${KUBE_ROOT}/scripts/.spelling_failures"
failing_packages=$(sed "s| | -e |g" "${skipping_file}")
git ls-files | grep content/${LANGUAGE} | grep -v -e "${failing_packages}" | xargs misspell > "${ERROR_LOG}"
if [[ -s "${ERROR_LOG}" ]]; then if [[ -s "${ERROR_LOG}" ]]; then
sed 's/^/error: /' "${ERROR_LOG}" # add 'error' to each line to highlight in e2e status sed 's/^/error: /' "${ERROR_LOG}" # add 'error' to each line to highlight in e2e status
echo "Found spelling errors!" echo "Found spelling errors!"