Commit b4265c2b authored by Leo's avatar Leo

Implement braced-variable

parent 35c93807
...@@ -245,6 +245,13 @@ variable_capitalized() { ...@@ -245,6 +245,13 @@ variable_capitalized() {
scan '(\t)?local [a-z0-9_ ]*[A-Z].*(=)?' 'variables must not have capital letters' 'AL31' 'MC' scan '(\t)?local [a-z0-9_ ]*[A-Z].*(=)?' 'variables must not have capital letters' 'AL31' 'MC'
} }
braced_variable() {
[ "$SKIP_BRACED_VARIABLE" ] && return 0
[ "$SKIP_AL32" ] && return 0
scan '(^|\t+)(local )?.*[A-Za-z0-9_]*=["A-Za-z0-9_]*\$\{.*\}($|[\-"])' \
'unnecesary usage of braces' 'AL32' 'MC'
}
_run_apkbuild_leo() { _run_apkbuild_leo() {
# Run all tests from Leo # Run all tests from Leo
pkgname_quoted & pkgname_quoted &
...@@ -282,6 +289,7 @@ for apkbuild; do ...@@ -282,6 +289,7 @@ for apkbuild; do
pkgname_used_in_source & pkgname_used_in_source &
double_underscore_in_variable & double_underscore_in_variable &
variable_capitalized & variable_capitalized &
braced_variable &
# Don't perform these checks on packages from main # Don't perform these checks on packages from main
if ! [ -z "${apkbuild##*main/*}" ]; then if ! [ -z "${apkbuild##*main/*}" ]; then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment