eolian: enable incorrect property doc warnings with env var
authorDaniel Kolesa <d.kolesa@osg.samsung.com>
Thu, 19 May 2016 15:57:12 +0000 (16:57 +0100)
committerDaniel Kolesa <d.kolesa@osg.samsung.com>
Thu, 19 May 2016 15:57:12 +0000 (16:57 +0100)
This adds env var EOLIAN_PROPERTY_DOC_WARN which enables extra
warnings for properties that don't have a general doc but have
getter/setter doc. This will eventually become an error and
will be enabled by default. For now it's too verbose.

src/lib/eolian/eo_parser.c

index 203821e..c945696 100644 (file)
@@ -1114,6 +1114,16 @@ parse_accessor(Eo_Lexer *ls, Eolian_Function *prop)
    line = ls->line_number;
    col = ls->column;
    check_next(ls, '{');
+   if ((ls->t.token == TOK_DOC) && !prop->common_doc)
+     {
+        if (getenv("EOLIAN_PROPERTY_DOC_WARN"))
+          {
+             fprintf(stderr, "eolian:%s:%d:%d: %s doc without property "
+                             "doc for '%s.%s'\n",
+                     prop->base.file, line, col, is_get ? "getter" : "setter",
+                     ls->tmp.kls->full_name, prop->name);
+          }
+     }
    if (is_get)
      {
         FILL_DOC(ls, prop, get_doc);