Merge: doc: fixed some typos and other misc. corrections
[nit.git] / src / nitpick.nit
index c7664a9..4e211b4 100644 (file)
@@ -16,6 +16,7 @@
 module nitpick
 
 import frontend
+import doc::vim_autocomplete
 
 redef class ToolContext
        # Modules to analyze, other modules will only get a shallow processing.
@@ -37,6 +38,9 @@ toolcontext.tooldescription = "Usage: nitpick [OPTION]... <file.nit>...\nCollect
 # We do not add other options, so process them now!
 toolcontext.process_options(args)
 
+# Do not stop phases on errors
+toolcontext.keep_going = true
+
 # Get arguments
 var arguments = toolcontext.option_context.rest
 
@@ -45,8 +49,16 @@ var model = new Model
 # A model builder to parse files
 var modelbuilder = new ModelBuilder(model, toolcontext)
 
-# Here we load an process all modules passed on the command line
-var mmodules = modelbuilder.parse(arguments)
+# Here we load and process all modules passed on the command line
+var mmodules = modelbuilder.parse_full(arguments)
 toolcontext.mmodules_to_check.add_all mmodules
 
+# Blacklist warnings of not explicitly required modules
+for mm in model.mmodules do
+       if mmodules.has(mm) then continue
+       toolcontext.warning_blacklist[mm.location.file].add("all")
+end
+
 modelbuilder.run_phases
+toolcontext.run_global_phases(mmodules)
+if toolcontext.error_count > 0 then exit(1)