After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 693098 - Add more warnings to help catch introspection issues
Add more warnings to help catch introspection issues
Status: RESOLVED FIXED
Product: gobject-introspection
Classification: Platform
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gobject-introspection Maintainer(s)
gobject-introspection Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2013-02-03 16:39 UTC by Jasper St. Pierre (not reading bugmail)
Modified: 2015-02-07 17:01 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
tests: Move do_moo to warnlib (9.94 KB, patch)
2013-02-03 16:39 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
warningtester: Sort the list of warnings (1.00 KB, patch)
2013-02-03 16:39 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
transformer: Warn on unnamed params in declarations (3.77 KB, patch)
2013-02-03 16:39 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
annotation: Fix invalid type (1.96 KB, patch)
2013-02-03 16:39 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
ast: Add a quick __repr__ to Field and Member (1023 bytes, patch)
2013-02-03 16:39 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
transformer: Ensure that types aren't resolved if we can't find them (4.66 KB, patch)
2013-02-03 16:39 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review

Description Jasper St. Pierre (not reading bugmail) 2013-02-03 16:39:13 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.
Comment 1 Jasper St. Pierre (not reading bugmail) 2013-02-03 16:39:16 UTC
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.
Comment 2 Jasper St. Pierre (not reading bugmail) 2013-02-03 16:39:18 UTC
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.
Comment 3 Jasper St. Pierre (not reading bugmail) 2013-02-03 16:39:22 UTC
Created attachment 235117 [details] [review]
transformer: Warn on unnamed params in declarations

These params are unannotatable and undocumentable. They really
should not be allowed.
Comment 4 Jasper St. Pierre (not reading bugmail) 2013-02-03 16:39:25 UTC
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.
Comment 5 Jasper St. Pierre (not reading bugmail) 2013-02-03 16:39:28 UTC
Created attachment 235119 [details] [review]
ast: Add a quick __repr__ to Field and Member

Nothing too specific, just something to help with debugging.
Comment 6 Jasper St. Pierre (not reading bugmail) 2013-02-03 16:39:31 UTC
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.
Comment 7 Colin Walters 2013-02-03 23:45:43 UTC
Review of attachment 235115 [details] [review]:

Fair enough.
Comment 8 Colin Walters 2013-02-03 23:45:44 UTC
Review of attachment 235115 [details] [review]:

Fair enough.
Comment 9 Colin Walters 2013-02-03 23:45:57 UTC
Review of attachment 235116 [details] [review]:

Ah, yes.
Comment 10 Colin Walters 2013-02-03 23:52:39 UTC
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?
Comment 11 Colin Walters 2013-02-03 23:53:25 UTC
Review of attachment 235118 [details] [review]:

Right.
Comment 12 Colin Walters 2013-02-03 23:54:25 UTC
Review of attachment 235119 [details] [review]:

OK.
Comment 13 Colin Walters 2013-02-04 00:44:43 UTC
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.
Comment 14 Jasper St. Pierre (not reading bugmail) 2013-02-07 09:30:08 UTC
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?
Comment 15 André Klapper 2015-02-07 17:01:48 UTC
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]