napoleon: Add aliases Warn and Raise

This commit is contained in:
Nguyễn Gia Phong 2020-06-29 16:15:49 +07:00
parent e4c3e24e85
commit 1a865069db
3 changed files with 5 additions and 0 deletions

View File

@ -14,6 +14,7 @@ Features added
-------------- --------------
* #7853: C and C++, support parameterized GNU style attributes. * #7853: C and C++, support parameterized GNU style attributes.
* #7888: napoleon: Add aliases Warn and Raise.
Bugs fixed Bugs fixed
---------- ----------

View File

@ -115,6 +115,7 @@ All of the following section headers are supported:
* ``Parameters`` * ``Parameters``
* ``Return`` *(alias of Returns)* * ``Return`` *(alias of Returns)*
* ``Returns`` * ``Returns``
* ``Raise`` *(alias of Raises)*
* ``Raises`` * ``Raises``
* ``References`` * ``References``
* ``See Also`` * ``See Also``
@ -122,6 +123,7 @@ All of the following section headers are supported:
* ``Todo`` * ``Todo``
* ``Warning`` * ``Warning``
* ``Warnings`` *(alias of Warning)* * ``Warnings`` *(alias of Warning)*
* ``Warn`` *(alias of Warns)*
* ``Warns`` * ``Warns``
* ``Yield`` *(alias of Yields)* * ``Yield`` *(alias of Yields)*
* ``Yields`` * ``Yields``

View File

@ -162,6 +162,7 @@ class GoogleDocstring:
'parameters': self._parse_parameters_section, 'parameters': self._parse_parameters_section,
'return': self._parse_returns_section, 'return': self._parse_returns_section,
'returns': self._parse_returns_section, 'returns': self._parse_returns_section,
'raise': self._parse_raises_section,
'raises': self._parse_raises_section, 'raises': self._parse_raises_section,
'references': self._parse_references_section, 'references': self._parse_references_section,
'see also': self._parse_see_also_section, 'see also': self._parse_see_also_section,
@ -169,6 +170,7 @@ class GoogleDocstring:
'todo': partial(self._parse_admonition, 'todo'), 'todo': partial(self._parse_admonition, 'todo'),
'warning': partial(self._parse_admonition, 'warning'), 'warning': partial(self._parse_admonition, 'warning'),
'warnings': partial(self._parse_admonition, 'warning'), 'warnings': partial(self._parse_admonition, 'warning'),
'warn': self._parse_warns_section,
'warns': self._parse_warns_section, 'warns': self._parse_warns_section,
'yield': self._parse_yields_section, 'yield': self._parse_yields_section,
'yields': self._parse_yields_section, 'yields': self._parse_yields_section,