Commit 1150c1f6 authored by Leo's avatar Leo

Rework braced-variables

parent a50e02fe
......@@ -248,8 +248,11 @@ variable_capitalized() {
braced_variable() {
[ "$SKIP_BRACED_VARIABLE" ] && return 0
[ "$SKIP_AL32" ] && return 0
scan '(^|\t+)(local )?.*[A-Za-z0-9_]*=["A-Za-z0-9_]*\$\{[a-z_]+\}($|[\-"])' \
'unnecesary usage of braces' 'AL32' 'MC'
# Match a Sigil ($) then a brace and any valid value until the end brace and then
# match end-of-line or a character that can't be in the name of a variable
grep -Eo -Hn -e '\$\{[A-Za-z0-9_]+\}($|["\./\-])' "$apkbuild" |
sed "s/^\([^:]*:[^:]*:\)\(.*\)/MP:[AL32]:\1unnecesary usage of braces: \2/" |
sed 's|[\./"\-]$||g' # This strips the last match in the grep
}
_run_apkbuild_leo() {
......
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