Commit cc54aeac authored by Leo's avatar Leo

add double-underscore-in-variable

parent 3c71cc94
......@@ -323,3 +323,10 @@ Instead, use the upstream name fully written out. This only counts for the url
itself, not the local archive name prefix.
Severity: Minor, Certainty: Certain
## double-underscore-in-variable [AL30]
Usage of double underscore in variables is forbidden, use always one underscore
for variables that are not used by abuild.
Severity: Minor, Certainty: Certain
......@@ -227,6 +227,12 @@ pkgname_used_in_source() {
scan '^source="[a-z]+://[^"]+\$\{?pkgname\}?' '$pkgname should not be used in the source url' 'AL29' 'MC'
}
double_underscore_in_variable() {
[ "$SKIP_DOUBLE_UNDERSCORE_IN_VARIABLE" ] && return 0
[ "$SKIP_AL30" ] && return 0
scan '(^|\t)(local ([A-Za-z_])?.*)?__.*(=)?' 'double underscore on variables are reserved' 'AL30' 'MC'
}
_run_apkbuild_leo() {
# Run all tests from Leo
pkgname_quoted &
......@@ -262,6 +268,7 @@ for apkbuild; do
newline_opening_brace &
literal_integer_is_quoted &
pkgname_used_in_source &
double_underscore_in_variable &
# Don't perform these checks on packages from main
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