Print correct order for include order/style issues
[alexxy/gromacs.git] / docs / doxygen / check-source.py
index 0856fb2a7de8b8cac69c45fcab351abd9caf996f..8295a6e5536b6474b5735173bfc7cc82d23cae3b 100755 (executable)
@@ -148,12 +148,6 @@ def check_include(fileobj, includedfile, reporter):
     if not otherfile:
         reporter.code_issue(includedfile,
                 "includes non-local file as {0}".format(includedfile))
-    # TODO: Reinstantiate a check once there is clarity on what we want
-    # to enforce.
-    #elif fileobj.is_installed() and not includedfile.is_relative():
-    #    reporter.code_issue(includedfile,
-    #            "installed header includes {0} using non-relative path"
-    #            .format(includedfile))
     if not otherfile:
         return
     if fileobj.is_installed() and not otherfile.is_installed():
@@ -360,9 +354,12 @@ def check_all(tree, reporter, check_ignored):
         check_file(fileobj, reporter)
         for includedfile in fileobj.get_includes():
             check_include(fileobj, includedfile, reporter)
-        if fileobj.should_includes_be_sorted() \
-                and not includesorter.check_sorted(fileobj):
-            reporter.code_issue(fileobj, "include style/order is not consistent")
+        if fileobj.should_includes_be_sorted():
+            is_sorted, details = includesorter.check_sorted(fileobj)
+            if not is_sorted:
+                details.append("You can use includesorter.py to do the sorting automatically; see docs/dev-manual/gmxtree.rst")
+                reporter.code_issue(fileobj,
+                        "include style/order is not consistent; see docs/dev-manual/includestyle.rst", details)
 
     for classobj in tree.get_classes():
         check_class(classobj, reporter)