GNOME Bugzilla – Bug 641347
add validation for (method) and (constructor) annotations
Last modified: 2015-02-07 16:44:41 UTC
jdahlin: there a warning testing framework in test/warn which should be extended to cover these annotations
Created attachment 180061 [details] [review] Add warnings for the (method) annotation
Created attachment 180073 [details] [review] Add warnings for the (constructor) annotation Applies on top of the previous patch
Created attachment 180935 [details] [review] Add warnings for the (method) annotation
Created attachment 180936 [details] [review] Add warnings for the (constructor) annotation
Review of attachment 180935 [details] [review]: Looks great otherwise. ::: giscanner/maintransformer.py @@ +932,3 @@ + message.warn_node(func, + '%s: Methods must belong to the same namespace as the ' + 'class they are into' % (func.symbol, )) as the class they belong to
Review of attachment 180936 [details] [review]: Looks good otherwise. ::: giscanner/maintransformer.py @@ +1052,3 @@ + if func.is_constructor: + message.warn_node(func, + '%s: Constructors must return an instance of their class' \ No need for the \ @@ +1073,3 @@ + message.warn_node(func, + '%s: Constructors must belong to the same namespace as the ' + 'class they are into' % (func.symbol, )) belongs to ::: tests/warn/invalid-constructor.h @@ +7,3 @@ +int test_constructor_invalid_return(); + +// EXPECT:7: Warning: Test: test_constructor_invalid_return: Constructors must return an instance of their class Perhaps you could add ", not int" to the end, but that might be complicated to implement.
Comment on attachment 180935 [details] [review] Add warnings for the (method) annotation Attachment 180935 [details] pushed as a988cd4 - Add warnings for the (method) annotation
Attachment 180936 [details] pushed as c8e0405 - Add warnings for the (constructor) annotation
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]