frontend: disable warnings for test modules
[nit.git] / src / frontend / no_warning.nit
index b3cfd30..54d9a01 100644 (file)
@@ -34,20 +34,22 @@ private class NoWarningPhase
 
                var source = nmodule.location.file
 
-               # If no decl block then quit
                var nmoduledecl = nmodule.n_moduledecl
-               if nmoduledecl == null then
+               if nmoduledecl == null or nmoduledecl.n_doc == null then
                        # Disable `missing-doc` if there is no `module` clause
                        # Rationale: the presence of a `module` clause is a good heuristic to
                        # discriminate quick and dirty prototypes from nice and clean modules
                        if source != null then toolcontext.warning_blacklist[source].add("missing-doc")
-                       return
+
                end
 
+               # If no decl block then quit
+               if nmoduledecl == null then return
+
                var modelbuilder = toolcontext.modelbuilder
 
-               # Disable `missing-doc` for `test_suite`
-               if source != null and not nmoduledecl.get_annotations("test_suite").is_empty then
+               # Disable `missing-doc` for `test`
+               if source != null and not nmoduledecl.get_annotations("test").is_empty then
                        toolcontext.warning_blacklist[source].add("missing-doc")
                end