Commit Graph

57 Commits

Author SHA1 Message Date
Keewis
a7bbedfbb7 add a test for the parameter type conversions 2020-07-16 00:19:22 +02:00
Takeshi KOMIYA
eb8f3b539a Revert "ext.napoleon: Emit type annotations at the start of .. attribute::"
This reverts commit 9d7171899a.
2020-06-13 16:28:58 +09:00
Takeshi KOMIYA
a28c9ad842 Fix #7734: napoleon: overescaped trailing underscore on attribute 2020-05-28 01:47:33 +09:00
Takeshi KOMIYA
1c3179300a
Merge pull request #7583 from eric-wieser/fix-napoleon
ext.napoleon: Emit type annotations at the start of `.. attribute::`
2020-05-02 12:33:59 +09:00
Eric Wieser
453fe55dc9 ext.napoleon: Do not consume colons within inline code
Fixes gh-7581
2020-04-30 08:57:24 +01:00
Eric Wieser
9d7171899a ext.napoleon: Emit type annotations at the start of .. attribute:: 2020-04-29 19:03:24 +01:00
Takeshi KOMIYA
89dd4bf438 Fix #6240: napoleon: Attributes and Methods sections ignore :noindex: option 2020-03-21 18:54:44 +09:00
Takeshi KOMIYA
b14439ca48 Fix #6999: napoleon: fails to parse tilde in :exc: role 2020-01-09 00:15:27 +09:00
Takeshi KOMIYA
eaf495c3c4 A happy new year! 2020-01-01 14:27:43 +09:00
Takeshi KOMIYA
c4dfc7402e Fix #6436: napoleon: "Unknown target name" error 2019-06-09 00:23:18 +09:00
Takeshi KOMIYA
8e356c3bf4 Fix #6220, #6225: napoleon: AttributeError is raised for raised section having references 2019-03-31 22:25:06 +09:00
Jon Dufresne
22afc77c48 Python-3-only clean ups discovered by pyupgrade
https://github.com/asottile/pyupgrade

> A tool to automatically upgrade syntax for newer versions of the
> language.

- Drop u str prefix
- Drop base object inheritance
- Drop args to super()
- Use set literals
- Use dict comprehension
- Use set comprehension
2019-03-19 01:09:48 +09:00
Takeshi KOMIYA
65970a3033 Fix #6140: Use unittest.mock instead of mock 2019-03-09 15:16:04 +09:00
Takeshi KOMIYA
76e9f57c2e Merge branch '1.8' 2019-01-02 16:16:25 +09:00
Takeshi KOMIYA
1b1ebd2c75 A happy new year! 2019-01-02 16:00:30 +09:00
Jon Dufresne
bade33c7e4 Remove unnecessary encoding cookie from Python source files
In Python 3, the default encoding of source files is utf-8. The encoding
cookie is now unnecessary and redundant so remove it. For more details,
see the docs:

https://docs.python.org/3/howto/unicode.html#the-string-type

> The default encoding for Python source code is UTF-8, so you can
> simply include a Unicode character in a string literal ...

Includes a fix for the flake8 header checks to stop expecting an
encoding cookie.
2018-12-16 12:22:12 -08:00
Rob Ruana
e547a6a0d2
Fixes #5426: [Napoleon] Better handling of inline attributes (#5470)
* Fixes #5426: [Napoleon] Better handling of inline attributes

* Removes uneeded NOQA comments

* Fixes imports
2018-09-23 09:26:17 -04:00
Antony Lee
dbb7c38220 Rendering of exceptions by napoleon. (#4046)
This lets napoleon render exceptions using the standard info field
syntax
```
:raises FooException: Some condition.
```
rather than the nonstandard
```
:raises: :exc:`FooException` -- Some condition.
```

Note that the previous approach was more forgiving if an explanatory
text was given in the Raises section without an actual exception class:
```
Raises
------
If something occurs.
```
would be rendered as
```
:raises: *If something occurs*
```
which is OK-ish but is now rendered as
```
:raises If something occurs.:
```
which is somewhat more nonsensical.

However neither the Google style guide nor numpydoc actually support
this form (they always have both the type and the description) so I
think the change is reasonable.
2018-09-23 08:31:27 -04:00
Takeshi KOMIYA
4073d4e850 Fix flake8 violations 2018-02-20 00:08:44 +09:00
Takeshi KOMIYA
938ba386ed Merge branch '1.7' 2018-02-20 00:02:57 +09:00
Takeshi KOMIYA
f7027049b1 Fix flake8 violations 2018-02-19 23:20:56 +09:00
Patrick Wingo
e505cbb3be Napoleon: custom section headers (#4387)
* Changes to allow for custom sections in google/numpy comments when parsing with napoleon

* fixed some formatting to pass flake8 tests
2018-02-15 16:16:23 -05:00
Martin Larralde
4d7c90d857 Implement missing napoleon admonitions 2018-02-13 18:02:02 +01:00
Rob Ruana
eb39f5714a
Merge pull request #4047 from AWhetter/fix_2979_2
Properties can have types documented with :type:
2018-02-03 17:42:49 -05:00
Takeshi KOMIYA
2426cedb8b A happy new year! 2018-01-01 01:06:58 +09:00
Ashley Whetter
8797ff51b3 Properties can have types documented with :type: 2017-09-06 15:57:11 -07:00
Takeshi KOMIYA
8f9dd64992 Merge branch 'stable' 2017-03-26 11:52:15 +09:00
Takeshi KOMIYA
c57e47e042 Year++ 2017-03-26 11:49:34 +09:00
Yoshiki Shibukawa
7e178785a7 fix style check warnings 2017-03-03 22:03:16 +09:00
Rob Ruana
f4716ed3a3 [Napoleon] adds xref test data for pull request #3168 2016-12-09 14:13:29 -08:00
Rob Ruana
407a525ac8 [Napoleon] adds xref test data for pull request #3168 2016-11-21 16:12:23 -08:00
shimizukawa
487f3db5f6 To simplify, sphinx uses external mock package even if unittest.mock exists. 2016-10-15 16:22:27 +09:00
Ashley Whetter
cfd4e51802 Python domain can now link container types automatically
Google types now greedily match the closing parenthesis.

Also removed name from returns section in Google docstrings.
Instead, everything before the colon is treated as the type.
2016-08-03 17:09:40 +01:00
Rob Ruana
8dde1eb02d Fix #2541: [Napoleon] Adds a blank line before parameter descriptions that start with a literal block 2016-06-11 23:55:55 -06:00
Jan Duzinkiewicz
d8cd3ec4be fix #2379 - Keyword args rendered with type links, as normal parameters (configurable under napoleon_use_keyword option) 2016-03-23 19:30:14 +01:00
Rob Ruana
678f6066f5 Fix #2227: [Napoleon] Fixes issue in which bulleted lists in parameter descriptions could cause the sphinx builder to fail 2016-01-27 10:16:12 -08:00
Georg Brandl
4f72bdb722 Merge branch 'stable' 2016-01-14 22:54:08 +01:00
Georg Brandl
46d7e8558e Obligatory copyright update. 2016-01-14 22:54:04 +01:00
Dean Moldovan
ac5c495a53 [Napoleon] Fix NumPy handling of *args and **kwargs parameters 2015-11-21 01:39:59 +01:00
Rob Ruana
6b6d3dbea9 Closes #1840: [Napoleon] Fixes Google style parsing to only match section headers ending with exactly one colon 2015-07-24 11:31:47 -07:00
Rob Ruana
c48c68eac9 Closes #1840: [Napoleon] Fixes Google style parsing to only match section headers ending with exactly one colon 2015-07-24 11:30:35 -07:00
Rob Ruana
4670c87be2 Related to #1927: [Napoleon] always start description on same line as type in Raises section 2015-06-11 12:50:05 -07:00
Rob Ruana
d82d110dfd Closes #1927: [Napoleon] fixes parsing & formatting of types in Raises section 2015-06-11 01:16:25 -07:00
Rob Ruana
89d30fca65 Closes #1927: [Napoleon] fixes parsing & formatting of types in Raises section 2015-06-11 01:15:52 -07:00
Rob Ruana
34add11b5d Closed #1925: [Napoleon] provides @property examples & recommends PEP 484 type hints in Napoleon docs 2015-06-09 18:18:22 -07:00
Rob Ruana
048f54f2b0 Closes #1904: [Napoleon] parses restructuredtext references in fields/params BEFORE splitting on colon 2015-05-27 10:58:26 -07:00
Rob Ruana
eade1e797e Closes #1904: [Napoleon] parses restructuredtext references in fields/params BEFORE splitting on colon 2015-05-27 10:57:04 -07:00
Rob Ruana
42f2b30579 Closes #1831: [Napoleon] Makes google type regex greedy to consume entire type, even if it contains colons 2015-05-03 16:30:40 -07:00
Rob Ruana
568f91d1bf Closes #1831: [Napoleon] Makes google type regex greedy to consume entire type, even if it contains colons 2015-05-03 16:28:39 -07:00
Rob Ruana
80eb821ec8 Closes #1831: [Napoleon] If name is not found in NumPy Doc Returns section, regard the whole line as the type 2015-04-03 21:34:23 -04:00