diff options
author | Dieter Verfaillie <dieterv@optionexplicit.be> | 2013-08-13 23:16:41 +0200 |
---|---|---|
committer | Dieter Verfaillie <dieterv@optionexplicit.be> | 2013-10-08 20:56:36 +0200 |
commit | 0af20939c8e2deaf1d1f06e069594d53acf65d2f (patch) | |
tree | 0fa1eac5ddc6f440552ddb200211f0915f889667 /giscanner | |
parent | f52986074fb44f523b35eb0b051c562269c723a8 (diff) | |
download | gobject-introspection-0af20939c8e2deaf1d1f06e069594d53acf65d2f.tar.gz |
giscanner: make some warnings errors
GTK-Doc comment block fixer tool will refuse to rewrite source
files that generated errors (indicating a source->parse tree->source
would result in information being lost), but will happily continue
on warnings (which do not result in information being lost).
Diffstat (limited to 'giscanner')
-rw-r--r-- | giscanner/annotationparser.py | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/giscanner/annotationparser.py b/giscanner/annotationparser.py index 45b2e66b..e37fbe82 100644 --- a/giscanner/annotationparser.py +++ b/giscanner/annotationparser.py @@ -1119,9 +1119,9 @@ class GtkDocCommentBlockParser(object): try: comment_block = self.parse_comment_block(comment, filename, lineno) except Exception: - warn('unrecoverable parse error, please file a GObject-Introspection ' - 'bug report including the complete comment block at the ' - 'indicated location.', Position(filename, lineno)) + error('unrecoverable parse error, please file a GObject-Introspection bug' + 'report including the complete comment block at the indicated location.', + Position(filename, lineno)) continue if comment_block is not None: @@ -1325,9 +1325,9 @@ class GtkDocCommentBlockParser(object): if not identifier_warned: identifier_warned = True marker = ' ' * column_offset + '^' - warn('identifier not found on the first line:\n%s\n%s' % - (original_line, marker), - position) + error('identifier not found on the first line:\n%s\n%s' % + (original_line, marker), + position) continue #################################################################### @@ -1356,9 +1356,9 @@ class GtkDocCommentBlockParser(object): if not returns_seen: returns_seen = True else: - warn("encountered multiple 'Returns' parameters or tags for " - "'%s'." % (comment_block.name, ), - position) + error('encountered multiple "Returns" parameters or tags for "%s".' % + (comment_block.name, ), + position) tag = GtkDocTag(TAG_RETURNS, position) @@ -1379,11 +1379,11 @@ class GtkDocCommentBlockParser(object): (param_name, original_line, marker), position) param_name = '...' - elif param_name in comment_block.params.keys(): - column = result.start('parameter_name') + column_offset - warn("multiple '@%s' parameters for identifier '%s':\n%s\n%s" % - (param_name, comment_block.name, original_line, marker), - position) + + if param_name in comment_block.params.keys(): + error('multiple "@%s" parameters for identifier "%s":\n%s\n%s' % + (param_name, comment_block.name, original_line, marker), + position) parameter = GtkDocParameter(param_name, position) @@ -1518,9 +1518,9 @@ class GtkDocCommentBlockParser(object): if not returns_seen: returns_seen = True else: - warn("encountered multiple 'Returns' parameters or tags for " - "'%s'." % (comment_block.name, ), - position) + error('encountered multiple return value parameters or tags for "%s".' % + (comment_block.name, ), + position) tag = GtkDocTag(TAG_RETURNS, position) @@ -1537,9 +1537,9 @@ class GtkDocCommentBlockParser(object): continue else: if tag_name_lower in comment_block.tags.keys(): - warn("multiple '%s:' tags for identifier '%s':\n%s\n%s" % - (tag_name, comment_block.name, original_line, marker), - position) + error('multiple "%s:" tags for identifier "%s":\n%s\n%s' % + (tag_name, comment_block.name, original_line, marker), + position) tag = GtkDocTag(tag_name_lower, position) @@ -1654,9 +1654,9 @@ class GtkDocCommentBlockParser(object): False) if success and annotations: marker = ' ' * (start_pos + column_offset) + '^' - warn('ignoring invalid multiline annotation continuation:\n%s\n%s' % - (original_line, marker), - position) + error('ignoring invalid multiline annotation continuation:\n%s\n%s' % + (original_line, marker), + position) def _parse_annotation_options_list(self, position, column, line, options): ''' |