From 6e2147496392e1975a55632bc3d1e04ca04ccf62 Mon Sep 17 00:00:00 2001
From: Giovanni Bussi <giovanni.bussi@gmail.com>
Date: Thu, 6 Apr 2017 10:33:48 +0200
Subject: [PATCH] plumedcheck in developer doc

---
 developer-doc/.gitignore  |  1 +
 developer-doc/Doxyfile    |  3 ++-
 developer-doc/Makefile    |  2 +-
 developer-doc/extract     | 23 +++++++++++++++++++++++
 src/maketools/plumedcheck | 13 +++++++++++++
 5 files changed, 40 insertions(+), 2 deletions(-)

diff --git a/developer-doc/.gitignore b/developer-doc/.gitignore
index 81d753315..7c39bad00 100644
--- a/developer-doc/.gitignore
+++ b/developer-doc/.gitignore
@@ -4,5 +4,6 @@
 /automatic
 /*PP.txt
 /links-to-user-manual.txt
+/plumedcheck.txt
 /coverage
 
diff --git a/developer-doc/Doxyfile b/developer-doc/Doxyfile
index ecee15a5f..6377b7403 100644
--- a/developer-doc/Doxyfile
+++ b/developer-doc/Doxyfile
@@ -766,7 +766,8 @@ INPUT                  = ./Intro.txt \
                          ./AddingAMeasure.txt \
                          ./AddingAMultColvar.txt \
                          ./InstallationLayout.txt \
-                         ./intro-git.txt
+                         ./intro-git.txt \
+                         ./plumedcheck.txt
 
 # This tag can be used to specify the character encoding of the source files
 # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
diff --git a/developer-doc/Makefile b/developer-doc/Makefile
index aa8cbd94e..e06ef46d0 100644
--- a/developer-doc/Makefile
+++ b/developer-doc/Makefile
@@ -13,7 +13,7 @@ ifeq ($(make_doc),yes)
 endif
 
 clean:
-	rm -fr automatic html latex *~ links-to-user-manual.txt coverage coverage.info
+	rm -fr automatic html latex *~ links-to-user-manual.txt plumedcheck.txt coverage coverage.info
 
 coverage:
 	lcov -c -d ../src/ --output-file coverage.info
diff --git a/developer-doc/extract b/developer-doc/extract
index b2b803f18..ffad04846 100755
--- a/developer-doc/extract
+++ b/developer-doc/extract
@@ -36,6 +36,29 @@ awk '
   printf("%s",".html\"> "$2" </a>\n");
 }' >  links-to-user-manual.txt
 
+cat ../src/maketools/plumedcheck | grep "# DOC:" |
+{
+cat << \EOF
+// This document is formatted for Doxygen
+/**
+
+EOF
+
+awk '
+{
+  sub("# DOC:","");
+  if($0~"^ *:..*: *"){
+     print ""
+     gsub(":","_");
+     print 
+     print ""
+  } else print $0
+  
+}END{
+  printf("%s\n","*/");
+}'
+} > plumedcheck.txt
+
 
 # Create a directory to put all the files in
 #rm -rf automatic
diff --git a/src/maketools/plumedcheck b/src/maketools/plumedcheck
index a6c94f835..751a07db3 100755
--- a/src/maketools/plumedcheck
+++ b/src/maketools/plumedcheck
@@ -1,6 +1,19 @@
 #! /bin/bash
 # vim: ft=awk
 
+# DOC: \page Plumedcheck Validating syntax with plumedcheck
+# DOC: 
+# DOC: Here is a list of coding rules that are enforced by the plumedcheck script.
+# DOC: These rules are necessary to be sure that the codebase is consistent.
+# DOC: Code not satisfying these rules will make the automatic test on travis-ci fail.
+# DOC: In the following we provide a list of errors that are detected automatically,
+# DOC: together with a short explanation of the reason we consider these as errors.
+# DOC: The names used are the same ones reported by plumedcheck.
+# DOC: The `plumedcheck` script can be used as is, but the simplest way to obtain a report
+# DOC: is to go to the `buildroot/src` directory and type `make plumedcheck`.
+# DOC: In case you think you have a valid reason for a code not passing the check
+# DOC: to be merged, please contact the developers.
+
 TEMP=$(mktemp)
 
 cat > $TEMP << \EOF
-- 
GitLab