GNOME Bugzilla – Bug 693098
Add more warnings to help catch introspection issues
Last modified: 2015-02-07 17:01:48 UTC
* Add a warning for parameters without names in function signatures. These can't be documented properly in JS or Python, so it makes sense to warn on them. * Add a warning for actually unresolved types. While looking through Regress, I found that it had an annotation: "(element-type GLib.Value)" which is incorrect (it's GObject.Value). This should be have been caught by the scanner.
Created attachment 235115 [details] [review] tests: Move do_moo to warnlib We want to warn on unnamed params in declarations to ensure that all functions are bindable. Thus, we need to move a test containing unnamed params to WarnLib so it can be tested.
Created attachment 235116 [details] [review] warningtester: Sort the list of warnings This means that we can simply put all warnings at the bottom, unrelated to the order that they're emitted in the code, keeping line numbers more stable.
Created attachment 235117 [details] [review] transformer: Warn on unnamed params in declarations These params are unannotatable and undocumentable. They really should not be allowed.
Created attachment 235118 [details] [review] annotation: Fix invalid type I'm quite sure this is a typo rather than an intended thing. This will gain a test and a warning soon.
Created attachment 235119 [details] [review] ast: Add a quick __repr__ to Field and Member Nothing too specific, just something to help with debugging.
Created attachment 235120 [details] [review] transformer: Ensure that types aren't resolved if we can't find them This ensures that things can't try to reference undefined/invalid types without emitting warnings, and that users need to include other GIRs at build time if they want to reference another type.
Review of attachment 235115 [details] [review]: Fair enough.
Review of attachment 235116 [details] [review]: Ah, yes.
Review of attachment 235117 [details] [review]: One question (ACN if it's OK): ::: giscanner/transformer.py @@ +702,3 @@ ptype = self._create_type_from_base(symbol.base_type, is_parameter=True) + + if symbol.ident is None and symbol.base_type and symbol.base_type.type != CTYPE_VOID: This doesn't warn for varargs?
Review of attachment 235118 [details] [review]: Right.
Review of attachment 235119 [details] [review]: OK.
Review of attachment 235120 [details] [review]: The core of the bugfix looks like just the first hunk to transformer.py. I'm not sure I understand the purpose of the rest of them. This code is a bit weird even before your patch because we have a .resolved boolean that, as far as I can tell, is never set. I'm not objecting to this patch, just wondering if all of it is necessary.
Attachment 235115 [details] pushed as b714353 - tests: Move do_moo to warnlib Attachment 235116 [details] pushed as e9887d2 - warningtester: Sort the list of warnings Attachment 235117 [details] pushed as 06f2eb7 - transformer: Warn on unnamed params in declarations Attachment 235118 [details] pushed as d06a453 - annotation: Fix invalid type Attachment 235119 [details] pushed as 71bc260 - ast: Add a quick __repr__ to Field and Member Attachment 235120 [details] pushed as 7bdc0b7 - transformer: Ensure that types aren't resolved if we can't find them We talked in person about the impact of the last patch, and ACN'd it together. Colin, do you want to give a summary?
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]