This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch eolian/improvements
in repository efl.

View the commit online.

commit d0444ea6de0a3312f2e9a96cb12988709d90f704
Author: Cedric BAIL <[email protected]>
AuthorDate: Thu Aug 20 18:33:59 2026 -0600

    eo: check the other direction too -- @nullable the code refuses
    
    Everything so far looked for annotations that were missing. The opposite
    error costs more: a parameter marked @nullable whose implementation
    starts with EINA_SAFETY_ON_NULL_RETURN is the API telling every binding
    that null is fine while the code turns it away. A C# caller passing null
    gets no warning and no effect.
    
    Nothing in the tree trips it today: the three properties whose getter
    answers null while the setter refuses it, Efl.Text_Font_Properties.
    font_family and Efl.Ui.Focus.Manager.manager_focus and .root, were split
    rather than annotated. A shared values block cannot express a property
    whose two directions disagree about null.
    
    All five checks are verified to fail when what they cover is undone.
    
    Co-Authored-By: Claude Opus 5 <[email protected]>
---
 scripts/check-nullable.py | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/scripts/check-nullable.py b/scripts/check-nullable.py
index 59036bc6c3..c634abbbb8 100755
--- a/scripts/check-nullable.py
+++ b/scripts/check-nullable.py
@@ -21,6 +21,9 @@ This script fails when they disagree:
   MISSING-NULL  a stable function provably returns NULL on a path that is not
                 an allocation failure or a precondition violation, and is not
                 annotated.
+  OVER-ANNOT    a parameter is @nullable but every implementation rejects null
+                with a safety macro. The API promises something the code
+                refuses; a generator will let callers write the crash.
   MISSING-FIELD a getter hands back a private-data field that no constructor
                 ever assigns. Eo data is calloc'd, so the field is null until
                 something sets it and a caller can see that -- there is no
@@ -252,6 +255,20 @@ def main():
 
     impls, body, src_text = c_bodies()
     missing_null = []
+    # Parameters that claim to accept null while the code turns it away.
+    over_annot = []
+    for cname, name, nullable, _ in rows:
+        if not nullable or name == '<return>':
+            continue
+        bodies = [body(i) for i in impls.get(cname, [])]
+        bodies = [b for b in bodies if b]
+        if not bodies:
+            continue
+        rejects = re.compile(r'EINA_SAFETY_ON_NULL_(RETURN|RETURN_VAL|GOTO)\s*\(\s*!?\s*'
+                             + re.escape(name) + r'\b')
+        if all(rejects.search(b) for _, b in bodies):
+            over_annot.append((cname, name))
+
     missing_field = []
     for cname, nullable in sorted(returns.items()):
         if nullable or cname in ALLOWED_UNANNOTATED:
@@ -277,7 +294,8 @@ def main():
             ('MISSING-DOC', missing_doc, '@nullable but the documentation never says so'),
             ('MISSING-ANNOT', missing_annot, 'documentation says null is allowed but @nullable is absent'),
             ('MISSING-NULL', missing_null, 'returns NULL on a contract path but is not @nullable'),
-            ('MISSING-FIELD', missing_field, 'returns a data field no constructor sets, so it can be null')):
+            ('MISSING-FIELD', missing_field, 'returns a data field no constructor sets, so it can be null'),
+            ('OVER-ANNOT', over_annot, '@nullable but every implementation rejects null')):
         if not items:
             print('  ok    %-14s none' % label)
             continue

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to