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
|
||||
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
|
||||
_check_abstractions
|
||||
_check_directory_mark
|
||||
|
|
@ -84,15 +96,6 @@ _check() {
|
|||
_check_profile
|
||||
_check_subprofiles
|
||||
|
||||
# Style check
|
||||
if [[ $line_number -lt 10 ]]; then
|
||||
_check_header
|
||||
fi
|
||||
_check_tabs
|
||||
_check_trailing
|
||||
_check_indentation
|
||||
_check_vim
|
||||
|
||||
done <"$file"
|
||||
|
||||
# Results
|
||||
|
|
@ -139,7 +142,6 @@ _check_directory_mark() {
|
|||
for pattern in "${DIRECTORIES[@]}"; do
|
||||
if [[ "$line" == *"$pattern"* ]]; then
|
||||
[[ "$line" == *'='* ]] && continue
|
||||
[[ "$line" =~ ^[[:space:]]*# ]] && continue
|
||||
if [[ ! "$line" == *"$pattern/"* ]]; then
|
||||
_err issue "$file:$line_number" "missing directory mark: '$pattern' instead of '$pattern/'"
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue