From 24632ae81beafbab9710718705d266536b1bf1ec Mon Sep 17 00:00:00 2001 From: Kenichi Omichi Date: Fri, 7 Oct 2022 18:21:53 +0900 Subject: [PATCH] Add check_typo job (#9361) To block merging pull requests which contain typo automatically. --- .gitlab-ci/lint.yml | 7 +++++++ docs/ansible.md | 2 +- docs/centos.md | 2 +- docs/vars.md | 2 +- .../containerd-common/defaults/main.yml | 2 +- .../templates/configuration-qemu.toml.j2 | 2 +- roles/kubernetes/preinstall/templates/chrony.conf.j2 | 2 +- roles/kubernetes/preinstall/templates/ntp.conf.j2 | 2 +- tests/scripts/check_typo.sh | 12 ++++++++++++ 9 files changed, 26 insertions(+), 7 deletions(-) create mode 100755 tests/scripts/check_typo.sh diff --git a/.gitlab-ci/lint.yml b/.gitlab-ci/lint.yml index 53f73e512..c9e1bdea4 100644 --- a/.gitlab-ci/lint.yml +++ b/.gitlab-ci/lint.yml @@ -75,6 +75,13 @@ check-readme-versions: script: - tests/scripts/check_readme_versions.sh +check-typo: + stage: unit-tests + tags: [light] + image: python:3 + script: + - tests/scripts/check_typo.sh + ci-matrix: stage: unit-tests tags: [light] diff --git a/docs/ansible.md b/docs/ansible.md index e1fb9a688..980b13650 100644 --- a/docs/ansible.md +++ b/docs/ansible.md @@ -281,7 +281,7 @@ For more information about Ansible and bastion hosts, read ## Mitogen -Mitogen support is deprecated, please see [mitogen related docs](/docs/mitogen.md) for useage and reasons for deprecation. +Mitogen support is deprecated, please see [mitogen related docs](/docs/mitogen.md) for usage and reasons for deprecation. ## Beyond ansible 2.9 diff --git a/docs/centos.md b/docs/centos.md index 6be5fb48b..67a1f174b 100644 --- a/docs/centos.md +++ b/docs/centos.md @@ -2,7 +2,7 @@ ## CentOS 7 -The maximum python version offically supported in CentOS is 3.6. Ansible as of version 5 (ansible core 2.12.x) increased their python requirement to python 3.8 and above. +The maximum python version officially supported in CentOS is 3.6. Ansible as of version 5 (ansible core 2.12.x) increased their python requirement to python 3.8 and above. Kubespray supports multiple ansible versions but only the default (5.x) gets wide testing coverage. If your deployment host is CentOS 7 it is recommended to use one of the earlier versions still supported. ## CentOS 8 diff --git a/docs/vars.md b/docs/vars.md index 97f0a710a..f75ff0069 100644 --- a/docs/vars.md +++ b/docs/vars.md @@ -183,7 +183,7 @@ Stack](https://github.com/kubernetes-sigs/kubespray/blob/master/docs/dns-stack.m * *containerd_default_runtime* - If defined, changes the default Containerd runtime used by the Kubernetes CRI plugin. * *containerd_additional_runtimes* - Sets the additional Containerd runtimes used by the Kubernetes CRI plugin. - [Default config](https://github.com/kubernetes-sigs/kubespray/blob/master/roles/container-engine/containerd/defaults/main.yml) can be overriden in inventory vars. + [Default config](https://github.com/kubernetes-sigs/kubespray/blob/master/roles/container-engine/containerd/defaults/main.yml) can be overridden in inventory vars. * *http_proxy/https_proxy/no_proxy/no_proxy_exclude_workers/additional_no_proxy* - Proxy variables for deploying behind a proxy. Note that no_proxy defaults to all internal cluster IPs and hostnames diff --git a/roles/container-engine/containerd-common/defaults/main.yml b/roles/container-engine/containerd-common/defaults/main.yml index 3a85d7f05..ae1c6e05a 100644 --- a/roles/container-engine/containerd-common/defaults/main.yml +++ b/roles/container-engine/containerd-common/defaults/main.yml @@ -4,7 +4,7 @@ containerd_package: 'containerd.io' yum_repo_dir: /etc/yum.repos.d -# Keep minimal repo information arround for cleanup +# Keep minimal repo information around for cleanup containerd_repo_info: repos: diff --git a/roles/container-engine/kata-containers/templates/configuration-qemu.toml.j2 b/roles/container-engine/kata-containers/templates/configuration-qemu.toml.j2 index f64647bdf..40382423d 100644 --- a/roles/container-engine/kata-containers/templates/configuration-qemu.toml.j2 +++ b/roles/container-engine/kata-containers/templates/configuration-qemu.toml.j2 @@ -459,7 +459,7 @@ enable_debug = {{ kata_containers_qemu_debug }} # # If enabled, the default trace mode is "dynamic" and the # default trace type is "isolated". The trace mode and type are set -# explicity with the `trace_type=` and `trace_mode=` options. +# explicitly with the `trace_type=` and `trace_mode=` options. # # Notes: # diff --git a/roles/kubernetes/preinstall/templates/chrony.conf.j2 b/roles/kubernetes/preinstall/templates/chrony.conf.j2 index 226f9bc99..7931f435d 100644 --- a/roles/kubernetes/preinstall/templates/chrony.conf.j2 +++ b/roles/kubernetes/preinstall/templates/chrony.conf.j2 @@ -12,7 +12,7 @@ driftfile /var/lib/chrony/drift {% if ntp_tinker_panic is sameas true %} # Force time sync if the drift exceeds the threshold specified -# Usefull for VMs that can be paused and much later resumed. +# Useful for VMs that can be paused and much later resumed. makestep 1.0 -1 {% else %} # Allow the system clock to be stepped in the first three updates diff --git a/roles/kubernetes/preinstall/templates/ntp.conf.j2 b/roles/kubernetes/preinstall/templates/ntp.conf.j2 index b49c2e4b2..abeb8996a 100644 --- a/roles/kubernetes/preinstall/templates/ntp.conf.j2 +++ b/roles/kubernetes/preinstall/templates/ntp.conf.j2 @@ -6,7 +6,7 @@ driftfile {{ ntp_driftfile }} {% if ntp_tinker_panic is sameas true %} # Always reset the clock, even if the new time is more than 1000s away -# from the current system time. Usefull for VMs that can be paused +# from the current system time. Useful for VMs that can be paused # and much later resumed. tinker panic 0 {% endif %} diff --git a/tests/scripts/check_typo.sh b/tests/scripts/check_typo.sh new file mode 100755 index 000000000..cdcf49bc7 --- /dev/null +++ b/tests/scripts/check_typo.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# cd to the root directory of kubespray +cd $(dirname $0)/../../ + +rm ./misspell* + +set -e +wget https://github.com/client9/misspell/releases/download/v0.3.4/misspell_0.3.4_linux_64bit.tar.gz +tar -zxvf ./misspell_0.3.4_linux_64bit.tar.gz +chmod 755 ./misspell +git ls-files | xargs ./misspell -error