Damcava35/test pre commit (#256)

* chore: make linter happy for existing code

* fix: add missing test 2.1.2_disable_bsd_intetd.sh

* feat: add basic pre commit

Ensure a check has a corresponding test

---------

Co-authored-by: Damien Cavagnini <damien.cavagnini@corp.ovh.com>
This commit is contained in:
damcav35
2025-06-23 10:23:43 +02:00
committed by GitHub
parent 9a225c6157
commit 99bc575714
8 changed files with 56 additions and 4 deletions

View File

@ -26,6 +26,8 @@ FILE='/etc/udev/rules.d/10-CIS_99.2_usb_devices.sh'
# This function will be called if the script status is on enabled / audit mode
audit() {
SEARCH_RES=0
# if SC2086 is fixed (double quotes) instead of skipped, then shellcheck will complain that double quotes will prevent the loop (SC2066)
# shellcheck disable=SC2086
for FILE_SEARCHED in $FILES_TO_SEARCH; do
if [ "$SEARCH_RES" = 1 ]; then break; fi
if $SUDO_CMD test -d "$FILE_SEARCHED"; then