1
0
mirror of https://github.com/pi-hole/pi-hole synced 2024-12-23 07:18:07 +00:00

Merge pull request #4713 from pi-hole/new/code-spell

Add code-spell action / Move editorconfig-checker action to smoke-tests
This commit is contained in:
yubiuser 2022-07-02 17:26:50 +02:00 committed by GitHub
commit 17485023a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 27 additions and 27 deletions

3
.codespellignore Normal file
View File

@ -0,0 +1,3 @@
doubleclick
wan
nwe

View File

@ -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

View File

@ -8,7 +8,7 @@ permissions:
contents: read contents: read
jobs: jobs:
smoke-test: smoke-tests:
if: github.event.pull_request.draft == false if: github.event.pull_request.draft == false
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
@ -16,19 +16,30 @@ jobs:
name: Checkout repository name: Checkout repository
uses: actions/checkout@v3 uses: actions/checkout@v3
- -
name: Run Smoke Tests name: Check scripts in repository are executable
run: | run: |
# Ensure scripts in repository are executable
IFS=$'\n'; IFS=$'\n';
for f in $(find . -name '*.sh'); do if [[ ! -x $f ]]; then echo "$f is not executable" && FAIL=1; fi ;done for f in $(find . -name '*.sh'); do if [[ ! -x $f ]]; then echo "$f is not executable" && FAIL=1; fi ;done
unset IFS; unset IFS;
# If FAIL is 1 then we fail. # 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: distro-test:
if: github.event.pull_request.draft == false if: github.event.pull_request.draft == false
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: smoke-test needs: smoke-tests
strategy: strategy:
matrix: matrix:
distro: [debian_10, debian_11, ubuntu_18, ubuntu_20, ubuntu_21, ubuntu_22, centos_7, centos_8, fedora_34] distro: [debian_10, debian_11, ubuntu_18, ubuntu_20, ubuntu_21, ubuntu_22, centos_7, centos_8, fedora_34]

View File

@ -584,7 +584,7 @@ disk_usage() {
# Additinal keywords can be added, separated by "|" # Additinal keywords can be added, separated by "|"
hide="curlftpfs" 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 for line in "${file_system[@]}"; do
if [[ ! $line =~ $hide ]]; then if [[ ! $line =~ $hide ]]; then
log_write " ${line}" log_write " ${line}"

View File

@ -296,7 +296,7 @@ trust-anchor=.,20326,8,2,E06D44B80B8F1D39A95C0B0D7C65D08458E880409BBC68345710423
# changes in the non-FQDN forwarding. This cannot be done in 01-pihole.conf # 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 # 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 # simply rewrite the entire corresponding config file (which is what the
# DHCP settings subroutie is doing) # DHCP settings subroutine is doing)
ProcessDHCPSettings ProcessDHCPSettings
} }

View File

@ -507,7 +507,7 @@
# (using /etc/hosts) then that name can be specified as the # (using /etc/hosts) then that name can be specified as the
# tftp_servername (the third option to dhcp-boot) and in that # tftp_servername (the third option to dhcp-boot) and in that
# case dnsmasq resolves this name and returns the resultant IP # 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. # load balance the tftp load among a set of servers.
#dhcp-boot=/var/ftpd/pxelinux.0,boothost,tftp_server_name #dhcp-boot=/var/ftpd/pxelinux.0,boothost,tftp_server_name

View File

@ -195,7 +195,7 @@ os_check() {
distro_part="${distro_and_versions%%=*}" distro_part="${distro_and_versions%%=*}"
versions_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 if [[ "${detected_os^^}" =~ ${distro_part^^} ]]; then
valid_os=true valid_os=true
IFS="," read -r -a supportedVer <<<"${versions_part}" 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" printf " If you are seeing this message and you do have a supported OS, please contact support.\\n"
fi fi
printf "\\n" 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 "\\n"
printf " If you wish to attempt to continue anyway, you can try one of the following commands to skip this check:\\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" printf "\\n"
@ -314,7 +314,7 @@ package_manager_detect() {
exit 1 exit 1
fi fi
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) OS_CHECK_DEPS=(grep dnsutils)
# Packages required to run this install script (stored as an array) # Packages required to run this install script (stored as an array)
INSTALLER_DEPS=(git iproute2 whiptail ca-certificates) INSTALLER_DEPS=(git iproute2 whiptail ca-certificates)

View File

@ -540,7 +540,7 @@ parseList() {
num_target_lines_new="$(grep -c "^" "${target}")" num_target_lines_new="$(grep -c "^" "${target}")"
# Number of new correctly added lines # Number of new correctly added lines
num_correct_lines="$(( num_target_lines_new-num_target_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_target_lines="$num_target_lines_new"
num_invalid="$(( num_source_lines-num_correct_lines ))" num_invalid="$(( num_source_lines-num_correct_lines ))"
if [[ "${num_invalid}" -eq 0 ]]; then if [[ "${num_invalid}" -eq 0 ]]; then

View File

@ -150,7 +150,7 @@ def get_directories_recursive(host, directory):
def test_installPihole_fresh_install_readableFiles(host): 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 # Whiptail dialog returns Cancel for user prompt
mock_command('whiptail', {'*': ('', '0')}, host) mock_command('whiptail', {'*': ('', '0')}, host)