Commit Graph

165 Commits

Author SHA1 Message Date
Takeshi KOMIYA
51332c7b08 Fix #8074: napoleon: Crashes during processing C-ext module
inspect.getfile() raises TypeError if given object is a C-extension.
This handles the exception not to be crashed.
2020-08-09 00:46:30 +09:00
Takeshi KOMIYA
a4996f9054 Fix #7780: napoleon: multiple params declaration was wrongly recognized
So far, napoleon converts multiple paramaters declrarations to single
paramaeter fields (`:param:` and `:type:`) unexpectedly.  As a result,
the output seems broken.

This converts it to multiple parameter fields (a pair of field for each
parameter declration) to build parameter successfully.

Note: The conversion rule is available only when napoleon_use_params=True.
2020-08-07 23:46:55 +09:00
Takeshi KOMIYA
62a6df8f3c
Merge pull request #8049 from keewis/type-preprocessing-without-use_param
enable type preprocessing without use_param
2020-08-07 23:37:22 +09:00
Keewis
849d3c18a7 remove the syntax checks from the escape method and update the tests 2020-08-05 19:22:43 +02:00
Keewis
478ab44d7e Merge branch '3.x' into escape-combined-args-kwargs 2020-08-04 18:38:03 +02:00
Keewis
af7d6a5be8 only allow "default <obj>" and "default: <obj>" for now 2020-08-04 12:20:09 +02:00
Keewis
cac6d1787d preprocess even with napoleon_use_param = False 2020-08-04 10:43:31 +02:00
Keewis
92e9cd488c use a regex to decide whether to postprocess a token starting with default 2020-08-01 13:38:38 +02:00
Keewis
02ff1cc290 use a upper-case name for the list of singleton names 2020-08-01 13:25:28 +02:00
Keewis
ccd24aa00f use complex to check for numerical values 2020-08-01 13:21:17 +02:00
Keewis
5ee6a03ca7 detect ... as a link 2020-08-01 13:21:17 +02:00
Keewis
a09c170808 skip whitespace only tokens 2020-08-01 13:21:17 +02:00
Keewis
b353dfed7b properly link ... to Ellipsis 2020-07-31 17:44:04 +02:00
Keewis
e39c1a8d6a add more delimiters so describing mappings becomes possible 2020-07-29 22:29:03 +02:00
Keewis
05bf00bd4c make the postprocessing a bit more robust and add tests 2020-07-29 22:23:51 +02:00
Keewis
56666e4f84 add ... and Ellipsis to the singletons referenced by ":obj:" 2020-07-29 02:34:46 +02:00
Keewis
58f84186e0 Merge branch '3.x' into escape-combined-args-kwargs 2020-07-25 15:15:06 +02:00
Keewis
864dd0b610 add a comment about default not being a official keyword 2020-07-25 11:54:02 +02:00
Keewis
920048466c don't provide a empty line number 2020-07-25 11:22:29 +02:00
Keewis
ae35f81d3d allow mapping to a long name 2020-07-21 17:13:41 +02:00
Keewis
9b425606e7 support pandas-style default spec by postprocessing tokens 2020-07-21 12:26:28 +02:00
Keewis
cc8baf60ec only transform the types if napoleon_use_param is true 2020-07-16 00:27:00 +02:00
Keewis
660b818636 add type hints and location information 2020-07-16 00:27:00 +02:00
Keewis
922054ed6f replace .format with %-style string interpolation 2020-07-16 00:27:00 +02:00
Keewis
2b981b6abd make sure singletons actually use :obj: 2020-07-16 00:27:00 +02:00
Keewis
804df88e8d use :class: as default role and only fall back to :obj: for singletons 2020-07-16 00:27:00 +02:00
Keewis
f4817be7a9 use the format method instead of f-strings 2020-07-16 00:26:59 +02:00
Keewis
7d8aaf2c03 remove a debug print 2020-07-16 00:26:59 +02:00
Keewis
fedceb25ff move the binary operator "or" to before the newline 2020-07-16 00:26:59 +02:00
Keewis
d177e58999 reimplement the value set combination function using collections.deque 2020-07-16 00:26:10 +02:00
Keewis
866c822e11 move the warnings to token_type 2020-07-16 00:26:10 +02:00
Keewis
37e02512fc make invalid value sets a literal to avoid further warnings 2020-07-16 00:26:10 +02:00
Keewis
b0da0e5aef remove the default for the default translation 2020-07-16 00:26:10 +02:00
Keewis
20e36007fe treat value sets as literals 2020-07-16 00:26:10 +02:00
Keewis
e3b7e16b0a move the regexes to top-level 2020-07-16 00:26:10 +02:00
Keewis
9bfbe252f1 set a default so translations don't to be specified 2020-07-16 00:26:09 +02:00
Keewis
eab49125e9 update the splitting regexp to handle braces in strings and escaped quotes 2020-07-16 00:26:09 +02:00
Keewis
ce60b555ee properly use sphinx's logger 2020-07-16 00:26:08 +02:00
Keewis
b846db7e53 emit a warning instead of raising an error 2020-07-16 00:25:19 +02:00
Keewis
27733d6f61 replace the custom role with markup 2020-07-16 00:24:27 +02:00
Keewis
e1d7edac25 rename the configuration option 2020-07-16 00:24:27 +02:00
Keewis
ad89b1f76a replace the hard-coded mapping of translations with a config option 2020-07-16 00:22:56 +02:00
Keewis
fc70205fb4 get the type converter function to work, verified by new tests 2020-07-16 00:22:56 +02:00
Keewis
25937f745a move tokenize_type_spec to its own function and add tests for it 2020-07-16 00:22:56 +02:00
Keewis
8ab210f1b0 don't use the obj role if it is not necessary 2020-07-16 00:22:56 +02:00
Keewis
ace933107a move the numpy type spec parsing function out of NumpyDocstring 2020-07-16 00:22:55 +02:00
Keewis
e9822139ee more flake8 2020-07-16 00:22:55 +02:00
Keewis
bd33b61d64 update the translations 2020-07-16 00:21:59 +02:00
Keewis
bdea34e54e don't treat instance as special 2020-07-16 00:21:59 +02:00
Keewis
bafb24dd93 actually apply the type conversion 2020-07-16 00:21:59 +02:00