From 0be987239e3c5c6f88033844dc77c285bc73d185 Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Sat, 2 Jul 2022 14:00:17 +0100 Subject: [PATCH] Adds spellcheck action to the smoke-tests (also moves editorconfig-checker to smoketests away from it's own action) Signed-off-by: Adam Warner --- .codespellignore | 3 +++ .github/workflows/editorconfig-checker.yml | 14 -------------- .github/workflows/test.yml | 21 ++++++++++++++++----- advanced/Scripts/piholeDebug.sh | 2 +- advanced/Scripts/webpage.sh | 2 +- advanced/dnsmasq.conf.original | 2 +- automated install/basic-install.sh | 6 +++--- gravity.sh | 2 +- test/test_any_automated_install.py | 2 +- 9 files changed, 27 insertions(+), 27 deletions(-) create mode 100644 .codespellignore delete mode 100644 .github/workflows/editorconfig-checker.yml diff --git a/.codespellignore b/.codespellignore new file mode 100644 index 00000000..501a3d67 --- /dev/null +++ b/.codespellignore @@ -0,0 +1,3 @@ +doubleclick +wan +nwe diff --git a/.github/workflows/editorconfig-checker.yml b/.github/workflows/editorconfig-checker.yml deleted file mode 100644 index 37b20ba3..00000000 --- a/.github/workflows/editorconfig-checker.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: editorconfig-checker - -on: - pull_request: - push: - -jobs: - build: - name: editorconfig-checker - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v3 - - uses: editorconfig-checker/action-editorconfig-checker@main - - run: editorconfig-checker diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 94980562..308997d7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,7 +8,7 @@ permissions: contents: read jobs: - smoke-test: + smoke-tests: if: github.event.pull_request.draft == false runs-on: ubuntu-latest steps: @@ -16,19 +16,30 @@ jobs: name: Checkout repository uses: actions/checkout@v3 - - name: Run Smoke Tests + name: Check scripts in repository are executable run: | - # Ensure scripts in repository are executable IFS=$'\n'; for f in $(find . -name '*.sh'); do if [[ ! -x $f ]]; then echo "$f is not executable" && FAIL=1; fi ;done unset IFS; # If FAIL is 1 then we fail. - [[ $FAIL == 1 ]] && exit 1 || echo "Smoke Tests Passed" + [[ $FAIL == 1 ]] && exit 1 || echo "Scripts are executable!" + - + name: Spell-Checking + uses: codespell-project/actions-codespell@master + with: + ignore_words_file: .codespellignore + - + name: Get editorconfig-checker + uses: editorconfig-checker/action-editorconfig-checker@main + - + name: Run editorconfig-checker + run: editorconfig-checker + distro-test: if: github.event.pull_request.draft == false runs-on: ubuntu-latest - needs: smoke-test + needs: smoke-tests strategy: matrix: distro: [debian_10, debian_11, ubuntu_18, ubuntu_20, ubuntu_21, ubuntu_22, centos_7, centos_8, fedora_34] diff --git a/advanced/Scripts/piholeDebug.sh b/advanced/Scripts/piholeDebug.sh index 473d6f11..c00245b4 100755 --- a/advanced/Scripts/piholeDebug.sh +++ b/advanced/Scripts/piholeDebug.sh @@ -584,7 +584,7 @@ disk_usage() { # Additinal keywords can be added, separated by "|" hide="curlftpfs" - # only show those lines not containg a sensitive phrase + # only show those lines not containing a sensitive phrase for line in "${file_system[@]}"; do if [[ ! $line =~ $hide ]]; then log_write " ${line}" diff --git a/advanced/Scripts/webpage.sh b/advanced/Scripts/webpage.sh index b429e898..279de9e9 100755 --- a/advanced/Scripts/webpage.sh +++ b/advanced/Scripts/webpage.sh @@ -296,7 +296,7 @@ trust-anchor=.,20326,8,2,E06D44B80B8F1D39A95C0B0D7C65D08458E880409BBC68345710423 # changes in the non-FQDN forwarding. This cannot be done in 01-pihole.conf # as we don't want to delete all local=/.../ lines so it's much safer to # simply rewrite the entire corresponding config file (which is what the - # DHCP settings subroutie is doing) + # DHCP settings subroutine is doing) ProcessDHCPSettings } diff --git a/advanced/dnsmasq.conf.original b/advanced/dnsmasq.conf.original index 6758f0b8..4aa5a8bf 100644 --- a/advanced/dnsmasq.conf.original +++ b/advanced/dnsmasq.conf.original @@ -507,7 +507,7 @@ # (using /etc/hosts) then that name can be specified as the # tftp_servername (the third option to dhcp-boot) and in that # case dnsmasq resolves this name and returns the resultant IP -# addresses in round robin fasion. This facility can be used to +# addresses in round robin fashion. This facility can be used to # load balance the tftp load among a set of servers. #dhcp-boot=/var/ftpd/pxelinux.0,boothost,tftp_server_name diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index f9ec9505..953e6203 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -195,7 +195,7 @@ os_check() { distro_part="${distro_and_versions%%=*}" versions_part="${distro_and_versions##*=}" - # If the distro part is a (case-insensistive) substring of the computer OS + # If the distro part is a (case-insensitive) substring of the computer OS if [[ "${detected_os^^}" =~ ${distro_part^^} ]]; then valid_os=true IFS="," read -r -a supportedVer <<<"${versions_part}" @@ -234,7 +234,7 @@ os_check() { printf " If you are seeing this message and you do have a supported OS, please contact support.\\n" fi printf "\\n" - printf " %bhttps://docs.pi-hole.net/main/prerequesites/#supported-operating-systems%b\\n" "${COL_LIGHT_GREEN}" "${COL_NC}" + printf " %bhttps://docs.pi-hole.net/main/prerequisites/#supported-operating-systems%b\\n" "${COL_LIGHT_GREEN}" "${COL_NC}" printf "\\n" printf " If you wish to attempt to continue anyway, you can try one of the following commands to skip this check:\\n" printf "\\n" @@ -314,7 +314,7 @@ package_manager_detect() { exit 1 fi fi - # Packages required to perfom the os_check (stored as an array) + # Packages required to perform the os_check (stored as an array) OS_CHECK_DEPS=(grep dnsutils) # Packages required to run this install script (stored as an array) INSTALLER_DEPS=(git iproute2 whiptail ca-certificates) diff --git a/gravity.sh b/gravity.sh index c5e9e414..77974694 100755 --- a/gravity.sh +++ b/gravity.sh @@ -540,7 +540,7 @@ parseList() { num_target_lines_new="$(grep -c "^" "${target}")" # Number of new correctly added lines num_correct_lines="$(( num_target_lines_new-num_target_lines ))" - # Upate number of lines in target file + # Update number of lines in target file num_target_lines="$num_target_lines_new" num_invalid="$(( num_source_lines-num_correct_lines ))" if [[ "${num_invalid}" -eq 0 ]]; then diff --git a/test/test_any_automated_install.py b/test/test_any_automated_install.py index e7389006..f42feef0 100644 --- a/test/test_any_automated_install.py +++ b/test/test_any_automated_install.py @@ -150,7 +150,7 @@ def get_directories_recursive(host, directory): def test_installPihole_fresh_install_readableFiles(host): ''' - confirms all neccessary files are readable by pihole user + confirms all necessary files are readable by pihole user ''' # Whiptail dialog returns Cancel for user prompt mock_command('whiptail', {'*': ('', '0')}, host)