[gobject-introspection] Include proper filename and lineno in doc warning
- From: Johan Dahlin <johan src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gobject-introspection] Include proper filename and lineno in doc warning
- Date: Mon, 20 Sep 2010 02:54:30 +0000 (UTC)
commit 2f6638b2c15aee49b08784f13bd5f945466f97a7
Author: Johan Dahlin <johan gnome org>
Date: Sun Sep 19 12:14:26 2010 -0300
Include proper filename and lineno in doc warning
giscanner/maintransformer.py | 4 +++-
tests/warn/unknown-parameter.h | 6 +++---
2 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/giscanner/maintransformer.py b/giscanner/maintransformer.py
index 242cb46..2bf2102 100644
--- a/giscanner/maintransformer.py
+++ b/giscanner/maintransformer.py
@@ -611,9 +611,11 @@ usage is void (*_gtk_reserved1)(void);"""
text = ', should be one of %s' % (
', '.join(repr(p) for p in allparams), )
+ tag = block.get(doc_name)
message.warn(
'%s: unknown parameter %r in documentation comment%s' % (
- block.name, doc_name, text))
+ block.name, doc_name, text),
+ [(block.filename, tag.lineno, -1)])
def _apply_annotations_callable(self, node, chain, block):
self._apply_annotations_annotated(node, block)
diff --git a/tests/warn/unknown-parameter.h b/tests/warn/unknown-parameter.h
index d1fc776..8d68dbb 100644
--- a/tests/warn/unknown-parameter.h
+++ b/tests/warn/unknown-parameter.h
@@ -7,7 +7,7 @@
*/
void test_param_mismatch(int *out);
-// EXPECT:: Warning: Test: test_param_mismatch: unknown parameter 'wrong_name' in documentation comment, should be 'out'
+// EXPECT:5: Warning: Test: test_param_mismatch: unknown parameter 'wrong_name' in documentation comment, should be 'out'
/**
* test_param_mismatch2:
@@ -16,7 +16,7 @@ void test_param_mismatch(int *out);
*/
void test_param_mismatch2(int a, int *out2);
-// EXPECT:: Warning: Test: test_param_mismatch2: unknown parameter 'wrong_name2' in documentation comment, should be one of 'a', 'out2'
+// EXPECT:14: Warning: Test: test_param_mismatch2: unknown parameter 'wrong_name2' in documentation comment, should be one of 'a', 'out2'
/**
* test_param_missing:
@@ -25,7 +25,7 @@ void test_param_mismatch2(int a, int *out2);
*/
void test_param_missing(void);
-// EXPECT:: Warning: Test: test_param_missing: unknown parameter 'missing' in documentation comment
+// EXPECT:23: Warning: Test: test_param_missing: unknown parameter 'missing' in documentation comment
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]