Skip to content

Commit 919995f

Browse files
committed
support ignoring files when check the spelling
Signed-off-by: yuswift <[email protected]>
1 parent 7318b18 commit 919995f

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

scripts/.spelling_failures

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
content/en/blog/_posts/2016-05-00-Coreosfest2016-Kubernetes-Community.md
2+
content/en/blog/_posts/2016-10-00-Dynamic-Provisioning-And-Storage-In-Kubernetes.md
3+
content/en/blog/_posts/2017-02-00-Postgresql-Clusters-Kubernetes-Statefulsets.md
4+
content/en/blog/_posts/2018-06-28-Airflow-Kubernetes-Operator.md
5+
content/en/blog/_posts/2018-10-02-network-bootable-farm-with-ltsp.md
6+
content/en/blog/_posts/2019-03-19-kubeedge-k8s-based-edge-intro.md
7+
content/en/blog/_posts/2020-05-06-third-party-dual-sourced-content.md
8+
content/en/blog/_posts/2020-05-21-wsl2-dockerdesktop-k8s.md
9+
content/en/blog/_posts/2020-07-27-kubernetes-1-17-release-interview.md
10+

scripts/verify-spelling.sh

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@
1515
# limitations under the License.
1616
##########
1717
# This script verifies mispellings in location. Today it only supports
18-
# verifying English locale but can be modified in a future to support
18+
# verifying English locale but can be modified in a future to support
1919
# also other locales.
2020
# You need to run this script inside the root directory of "website" git repo.
21-
#
21+
#
2222
# Syntax: verify-spelling.sh LOCALE
2323
# Example: verify-spelling.sh en
2424
# If no locale is passed, it will assume "en"
25-
#
25+
#
2626
# Requirements:
2727
# - go v1.14 or superior version
2828

@@ -34,6 +34,9 @@ set -o pipefail
3434

3535
TOOL_VERSION="v0.3.4"
3636

37+
KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
38+
export KUBE_ROOT
39+
3740
LANGUAGE="${1:-en}"
3841
# cd to the root path
3942
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)"
@@ -60,7 +63,9 @@ cd "${ROOT}"
6063
RES=0
6164
echo "Checking spelling..."
6265
ERROR_LOG="${TMP_DIR}/errors.log"
63-
git ls-files | grep content/${LANGUAGE} | xargs misspell > "${ERROR_LOG}"
66+
skipping_file="${KUBE_ROOT}/scripts/.spelling_failures"
67+
failing_packages=$(sed "s| | -e |g" "${skipping_file}")
68+
git ls-files | grep content/${LANGUAGE} | grep -v -e "${failing_packages}" | xargs misspell > "${ERROR_LOG}"
6469
if [[ -s "${ERROR_LOG}" ]]; then
6570
sed 's/^/error: /' "${ERROR_LOG}" # add 'error' to each line to highlight in e2e status
6671
echo "Found spelling errors!"

0 commit comments

Comments
 (0)