Commit 3f7864cb authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Fix minaccept test for opening bracket following an if statement

The regex looking for lines of the form "if(..." is too slack, and
fails perfectly fine function calls like "imagegif(...".

Also, ensure that the elseif check doesn't match an elseif that's part
of some longer word.

Change-Id: I747af2867f8d3e8f31cabd50c1958e84ae0f63a8
Signed-off-by: default avatarRichard Mansfield <>
parent d5d50051
......@@ -57,10 +57,10 @@ while (<>) {
if (/\}\s*(else|catch)/) {
bad_line("cuddled elses/catches are against Mahara coding guidelines", $_);
if (/elseif/) {
if (/\belseif\b/) {
bad_line("a single space is requred between an else and an if on the same line", $_);
if (/(if|while|for)\(/ || /(if|while|for)\s\s+\(/) {
if (/\b(if|while|for)\(/ || /\b(if|while|for)\s\s+\(/) {
bad_line("conditional and looping statements should have a space between keywords ".
"and the condition brackets", $_);
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