no_warning: automatically disable `missing-doc` on test_suites
authorJean Privat <jean@pryen.org>
Sat, 20 Dec 2014 13:46:55 +0000 (08:46 -0500)
committerJean Privat <jean@pryen.org>
Sat, 20 Dec 2014 19:15:21 +0000 (14:15 -0500)
Signed-off-by: Jean Privat <jean@pryen.org>

src/frontend/no_warning.nit

index c862075..3c31b65 100644 (file)
@@ -38,13 +38,20 @@ private class NoWarningPhase
 
                var modelbuilder = toolcontext.modelbuilder
 
-               # Get all the new annotations
+               var source = nmodule.location.file
+
+               # Disable `missing-doc` for `test_suite`
+               if source != null and not nmoduledecl.get_annotations("test_suite").is_empty then
+                       toolcontext.warning_blacklist[source].add("missing-doc")
+               end
+
+
+               # Get all the `no_warning` annotations
                var name = "no_warning"
                var annots = nmoduledecl.get_annotations(name)
 
                if annots.is_empty then return
 
-               var source = nmodule.location.file
                if source == null then
                        modelbuilder.warning(annots.first, "file-less-module", "Warning: annotation `{name}` does not currently work on file-less modules.")
                        return