toolcontext: attach messages to location, even if quieted
authorJean Privat <jean@pryen.org>
Sat, 14 May 2016 01:26:59 +0000 (21:26 -0400)
committerJean Privat <jean@pryen.org>
Sat, 14 May 2016 01:26:59 +0000 (21:26 -0400)
Signed-off-by: Jean Privat <jean@pryen.org>

src/toolcontext.nit

index 7ea200b..3190c6d 100644 (file)
@@ -264,12 +264,12 @@ class ToolContext
        # Return the message (to add information) or null if the warning is disabled
        fun warning(l: nullable Location, tag: String, text: String): nullable Message
        do
-               if opt_warning.value.has("no-{tag}") then return null
-               if not opt_warning.value.has(tag) and opt_warn.value == 0 then return null
                if is_warning_blacklisted(l, tag) then return null
                var m = new Message(l, tag, text, 1)
                if messages.has(m) then return null
                if l != null then l.add_message m
+               if opt_warning.value.has("no-{tag}") then return null
+               if not opt_warning.value.has(tag) and opt_warn.value == 0 then return null
                messages.add m
                warning_count = warning_count + 1
                if opt_stop_on_first_error.value then check_errors
@@ -293,12 +293,12 @@ class ToolContext
        # Return the message (to add information) or null if the warning is disabled
        fun advice(l: nullable Location, tag: String, text: String): nullable Message
        do
-               if opt_warning.value.has("no-{tag}") then return null
-               if not opt_warning.value.has(tag) and opt_warn.value <= 1 then return null
                if is_warning_blacklisted(l, tag) then return null
                var m = new Message(l, tag, text, 0)
                if messages.has(m) then return null
                if l != null then l.add_message m
+               if opt_warning.value.has("no-{tag}") then return null
+               if not opt_warning.value.has(tag) and opt_warn.value <= 1 then return null
                messages.add m
                warning_count = warning_count + 1
                if opt_stop_on_first_error.value then check_errors