tests(check): globally ignore check in commented lines.

This commit is contained in:
Alexandre Pujol 2025-07-22 23:55:46 +02:00 committed by Alex
parent 5adc290870
commit cd15178c81

View file

@ -70,6 +70,18 @@ _check() {
continue continue
fi fi
# Style check
if [[ $line_number -lt 10 ]]; then
_check_header
fi
_check_tabs
_check_trailing
_check_indentation
_check_vim
# The following checks do not apply to comment lines
[[ "$line" =~ ^[[:space:]]*# ]] && continue
# Rules checks # Rules checks
_check_abstractions _check_abstractions
_check_directory_mark _check_directory_mark
@ -84,15 +96,6 @@ _check() {
_check_profile _check_profile
_check_subprofiles _check_subprofiles
# Style check
if [[ $line_number -lt 10 ]]; then
_check_header
fi
_check_tabs
_check_trailing
_check_indentation
_check_vim
done <"$file" done <"$file"
# Results # Results
@ -139,7 +142,6 @@ _check_directory_mark() {
for pattern in "${DIRECTORIES[@]}"; do for pattern in "${DIRECTORIES[@]}"; do
if [[ "$line" == *"$pattern"* ]]; then if [[ "$line" == *"$pattern"* ]]; then
[[ "$line" == *'='* ]] && continue [[ "$line" == *'='* ]] && continue
[[ "$line" =~ ^[[:space:]]*# ]] && continue
if [[ ! "$line" == *"$pattern/"* ]]; then if [[ ! "$line" == *"$pattern/"* ]]; then
_err issue "$file:$line_number" "missing directory mark: '$pattern' instead of '$pattern/'" _err issue "$file:$line_number" "missing directory mark: '$pattern' instead of '$pattern/'"
fi fi