Move document checking to a C++ header file

* It's better to edit C++ source natively not in the SWIG file, and also
  clang-format can format it.
This commit is contained in:
baldurk
2017-03-29 16:33:01 +01:00
parent b2cadbfb63
commit b8d3efdb31
6 changed files with 113 additions and 76 deletions
+20 -1
View File
@@ -102,4 +102,23 @@ PyObject *PassObjectToPython(const char *type, void *obj)
%}
%include "document_check.i"
%header %{
#include <set>
#include "Code/pyrenderdoc/document_check.h"
%}
%init %{
// verify that docstrings aren't duplicated, which is a symptom of missing DOCUMENT()
// macros around newly added classes/members.
// For enums, verify that all constants are documented in the parent docstring
#if !defined(RELEASE)
static bool doc_checked = false;
if(!doc_checked)
{
doc_checked = true;
check_docstrings(swig_type_initial, sizeof(swig_type_initial)/sizeof(swig_type_initial[0]));
}
#endif
%}