Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ext.napoleon: Add aliases Warn and Raise #7888

Merged
merged 1 commit into from Jun 29, 2020
Merged

ext.napoleon: Add aliases Warn and Raise #7888

merged 1 commit into from Jun 29, 2020

Conversation

McSinyx
Copy link
Contributor

@McSinyx McSinyx commented Jun 29, 2020

Subject: Add imperative aliases for Napoleon sections (Warn and Raise)

Feature or Bugfix

Feature

Purpose

In McSinyx/palace#109, we decided to follow PEP 257 guide on using imperative verbs in docstrings. While Return and Yield are now excepted as an alias for Returns and Yields respectively, Warn and Raise are yet to be recognized by Napoleon. This PR precisely add the aliases for these.

Detail

In Napoleon extension:

  • Add Warn as an alias for Warns
  • Add Raise as an alias for Raises

I couldn't found tests for aliasing these keys so I didn't provide any QA mechanism this patch.

@tk0miya tk0miya added this to the 3.2.0 milestone Jun 29, 2020
Copy link
Member

@tk0miya tk0miya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update document of napoleon (doc/usage/extensions/napoleon.rst) too?

@McSinyx
Copy link
Contributor Author

McSinyx commented Jun 29, 2020

Thanks for the reminder, I completely forgot about that despite commenting about it in the linked issue 😄

Copy link
Member

@tk0miya tk0miya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution. LGTM

@tk0miya tk0miya merged commit ec9af60 into sphinx-doc:3.x Jun 29, 2020
@McSinyx McSinyx deleted the imperative-napoleon branch June 29, 2020 15:34
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants