mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #6368 from tk0miya/refactor_autodoc
Reduce warnings of autodoc in 2.0 branch
This commit is contained in:
commit
048fd3d09c
@ -400,9 +400,7 @@ class Documenter:
|
|||||||
try:
|
try:
|
||||||
args = self.format_args(**kwargs)
|
args = self.format_args(**kwargs)
|
||||||
except TypeError:
|
except TypeError:
|
||||||
warnings.warn("Documenter.format_args() takes keyword arguments "
|
# retry without arguments for old documenters
|
||||||
"since Sphinx-2.1",
|
|
||||||
RemovedInSphinx40Warning)
|
|
||||||
args = self.format_args()
|
args = self.format_args()
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
logger.warning(__('error while formatting arguments for %s: %s') %
|
logger.warning(__('error while formatting arguments for %s: %s') %
|
||||||
|
@ -63,7 +63,7 @@ from typing import List, cast
|
|||||||
|
|
||||||
from docutils import nodes
|
from docutils import nodes
|
||||||
from docutils.parsers.rst import directives
|
from docutils.parsers.rst import directives
|
||||||
from docutils.parsers.rst.states import RSTStateMachine, state_classes
|
from docutils.parsers.rst.states import RSTStateMachine, Struct, state_classes
|
||||||
from docutils.statemachine import StringList
|
from docutils.statemachine import StringList
|
||||||
|
|
||||||
import sphinx
|
import sphinx
|
||||||
@ -175,7 +175,10 @@ _app = None # type: Sphinx
|
|||||||
class FakeDirective(DocumenterBridge):
|
class FakeDirective(DocumenterBridge):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
# type: () -> None
|
# type: () -> None
|
||||||
super().__init__({}, None, Options(), 0, None) # type: ignore
|
settings = Struct(tab_width=8)
|
||||||
|
document = Struct(settings=settings)
|
||||||
|
state = Struct(document=document)
|
||||||
|
super().__init__({}, None, Options(), 0, state) # type: ignore
|
||||||
|
|
||||||
|
|
||||||
def get_documenter(app, obj, parent):
|
def get_documenter(app, obj, parent):
|
||||||
|
Loading…
Reference in New Issue
Block a user