tests(check): globally ignore check in commented lines.
This commit is contained in:
parent
d8b1d1b4ae
commit
42ba206c1c
1 changed files with 12 additions and 10 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue