Edgewall Software
Modify

Opened 2 years ago

Closed 9 days ago

#13599 closed defect (fixed)

The first parameter in the API docs for the interface's methods is incorrectly stripped

Reported by: Jun Omae Owned by: Jun Omae
Priority: normal Milestone: 1.6.1
Component: general Version:
Severity: normal Keywords:
Cc: Branch:
Release Notes:

apidoc: Fixed disappeared first positional argument of methods in Interface classes.

API Changes:
Internal Changes:

Description

Attachments (0)

Change History (3)

comment:1 by Jun Omae, 2 years ago

Milestone: 1.61.6.1

comment:2 by Jun Omae, 10 days ago

Owner: set to Jun Omae
Status: newassigned

We could fix it using custom documentater like the following:

  • doc/conf.py

    diff --git a/doc/conf.py b/doc/conf.py
    index 101f01b19..633c682b6 100644
    a b def setup(app):  
    372372        return [node], []
    373373    roles.register_canonical_role('extensionpoints', extensionpoints_role)
    374374
     375    import inspect
     376    from sphinx.ext import autodoc
     377    from sphinx.util.inspect import stringify_signature
     378
     379    class MethodDocumenter(autodoc.MethodDocumenter):
     380
     381        def format_args(self, **kwargs):
     382            if isinstance(self.parent, type):
     383                if any(base.__module__ == 'trac.core' and
     384                        base.__name__ == 'Interface'
     385                        for base in self.parent.__bases__):
     386                    sig = inspect.signature(self.object)
     387                    return stringify_signature(sig)
     388            return super().format_args(**kwargs)
     389
     390    app.add_autodocumenter(MethodDocumenter, override=True)
     391
    375392    # ifconfig variables
    376393    app.add_config_value('devel', True, '')
    377394    if html_jinja_lexer:

comment:3 by Jun Omae, 9 days ago

Release Notes: modified (diff)
Resolution: fixed
Status: assignedclosed

Pushed the changes in [17908] and merged in [17909].

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jun Omae.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jun Omae to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.