docparams.py 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675
  1. # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
  2. # For details: https://github.com/pylint-dev/pylint/blob/main/LICENSE
  3. # Copyright (c) https://github.com/pylint-dev/pylint/blob/main/CONTRIBUTORS.txt
  4. """Pylint plugin for checking in Sphinx, Google, or Numpy style docstrings."""
  5. from __future__ import annotations
  6. import re
  7. from typing import TYPE_CHECKING
  8. import astroid
  9. from astroid import nodes
  10. from pylint.checkers import BaseChecker
  11. from pylint.checkers import utils as checker_utils
  12. from pylint.extensions import _check_docs_utils as utils
  13. from pylint.extensions._check_docs_utils import Docstring
  14. from pylint.interfaces import HIGH
  15. if TYPE_CHECKING:
  16. from pylint.lint import PyLinter
  17. class DocstringParameterChecker(BaseChecker):
  18. """Checker for Sphinx, Google, or Numpy style docstrings.
  19. * Check that all function, method and constructor parameters are mentioned
  20. in the params and types part of the docstring. Constructor parameters
  21. can be documented in either the class docstring or ``__init__`` docstring,
  22. but not both.
  23. * Check that there are no naming inconsistencies between the signature and
  24. the documentation, i.e. also report documented parameters that are missing
  25. in the signature. This is important to find cases where parameters are
  26. renamed only in the code, not in the documentation.
  27. * Check that all explicitly raised exceptions in a function are documented
  28. in the function docstring. Caught exceptions are ignored.
  29. Activate this checker by adding the line::
  30. load-plugins=pylint.extensions.docparams
  31. to the ``MAIN`` section of your ``.pylintrc``.
  32. """
  33. name = "parameter_documentation"
  34. msgs = {
  35. "W9005": (
  36. '"%s" has constructor parameters documented in class and __init__',
  37. "multiple-constructor-doc",
  38. "Please remove parameter declarations in the class or constructor.",
  39. ),
  40. "W9006": (
  41. '"%s" not documented as being raised',
  42. "missing-raises-doc",
  43. "Please document exceptions for all raised exception types.",
  44. ),
  45. "W9008": (
  46. "Redundant returns documentation",
  47. "redundant-returns-doc",
  48. "Please remove the return/rtype documentation from this method.",
  49. ),
  50. "W9010": (
  51. "Redundant yields documentation",
  52. "redundant-yields-doc",
  53. "Please remove the yields documentation from this method.",
  54. ),
  55. "W9011": (
  56. "Missing return documentation",
  57. "missing-return-doc",
  58. "Please add documentation about what this method returns.",
  59. {"old_names": [("W9007", "old-missing-returns-doc")]},
  60. ),
  61. "W9012": (
  62. "Missing return type documentation",
  63. "missing-return-type-doc",
  64. "Please document the type returned by this method.",
  65. # we can't use the same old_name for two different warnings
  66. # {'old_names': [('W9007', 'missing-returns-doc')]},
  67. ),
  68. "W9013": (
  69. "Missing yield documentation",
  70. "missing-yield-doc",
  71. "Please add documentation about what this generator yields.",
  72. {"old_names": [("W9009", "old-missing-yields-doc")]},
  73. ),
  74. "W9014": (
  75. "Missing yield type documentation",
  76. "missing-yield-type-doc",
  77. "Please document the type yielded by this method.",
  78. # we can't use the same old_name for two different warnings
  79. # {'old_names': [('W9009', 'missing-yields-doc')]},
  80. ),
  81. "W9015": (
  82. '"%s" missing in parameter documentation',
  83. "missing-param-doc",
  84. "Please add parameter declarations for all parameters.",
  85. {"old_names": [("W9003", "old-missing-param-doc")]},
  86. ),
  87. "W9016": (
  88. '"%s" missing in parameter type documentation',
  89. "missing-type-doc",
  90. "Please add parameter type declarations for all parameters.",
  91. {"old_names": [("W9004", "old-missing-type-doc")]},
  92. ),
  93. "W9017": (
  94. '"%s" differing in parameter documentation',
  95. "differing-param-doc",
  96. "Please check parameter names in declarations.",
  97. ),
  98. "W9018": (
  99. '"%s" differing in parameter type documentation',
  100. "differing-type-doc",
  101. "Please check parameter names in type declarations.",
  102. ),
  103. "W9019": (
  104. '"%s" useless ignored parameter documentation',
  105. "useless-param-doc",
  106. "Please remove the ignored parameter documentation.",
  107. ),
  108. "W9020": (
  109. '"%s" useless ignored parameter type documentation',
  110. "useless-type-doc",
  111. "Please remove the ignored parameter type documentation.",
  112. ),
  113. "W9021": (
  114. 'Missing any documentation in "%s"',
  115. "missing-any-param-doc",
  116. "Please add parameter and/or type documentation.",
  117. ),
  118. }
  119. options = (
  120. (
  121. "accept-no-param-doc",
  122. {
  123. "default": True,
  124. "type": "yn",
  125. "metavar": "<y or n>",
  126. "help": "Whether to accept totally missing parameter "
  127. "documentation in the docstring of a function that has "
  128. "parameters.",
  129. },
  130. ),
  131. (
  132. "accept-no-raise-doc",
  133. {
  134. "default": True,
  135. "type": "yn",
  136. "metavar": "<y or n>",
  137. "help": "Whether to accept totally missing raises "
  138. "documentation in the docstring of a function that "
  139. "raises an exception.",
  140. },
  141. ),
  142. (
  143. "accept-no-return-doc",
  144. {
  145. "default": True,
  146. "type": "yn",
  147. "metavar": "<y or n>",
  148. "help": "Whether to accept totally missing return "
  149. "documentation in the docstring of a function that "
  150. "returns a statement.",
  151. },
  152. ),
  153. (
  154. "accept-no-yields-doc",
  155. {
  156. "default": True,
  157. "type": "yn",
  158. "metavar": "<y or n>",
  159. "help": "Whether to accept totally missing yields "
  160. "documentation in the docstring of a generator.",
  161. },
  162. ),
  163. (
  164. "default-docstring-type",
  165. {
  166. "type": "choice",
  167. "default": "default",
  168. "metavar": "<docstring type>",
  169. "choices": list(utils.DOCSTRING_TYPES),
  170. "help": "If the docstring type cannot be guessed "
  171. "the specified docstring type will be used.",
  172. },
  173. ),
  174. )
  175. constructor_names = {"__init__", "__new__"}
  176. not_needed_param_in_docstring = {"self", "cls"}
  177. def visit_functiondef(self, node: nodes.FunctionDef) -> None:
  178. """Called for function and method definitions (def).
  179. :param node: Node for a function or method definition in the AST
  180. :type node: :class:`astroid.scoped_nodes.Function`
  181. """
  182. node_doc = utils.docstringify(
  183. node.doc_node, self.linter.config.default_docstring_type
  184. )
  185. # skip functions that match the 'no-docstring-rgx' config option
  186. no_docstring_rgx = self.linter.config.no_docstring_rgx
  187. if no_docstring_rgx and re.match(no_docstring_rgx, node.name):
  188. return
  189. # skip functions smaller than 'docstring-min-length'
  190. lines = checker_utils.get_node_last_lineno(node) - node.lineno
  191. max_lines = self.linter.config.docstring_min_length
  192. if max_lines > -1 and lines < max_lines:
  193. return
  194. self.check_functiondef_params(node, node_doc)
  195. self.check_functiondef_returns(node, node_doc)
  196. self.check_functiondef_yields(node, node_doc)
  197. visit_asyncfunctiondef = visit_functiondef
  198. def check_functiondef_params(
  199. self, node: nodes.FunctionDef, node_doc: Docstring
  200. ) -> None:
  201. node_allow_no_param = None
  202. if node.name in self.constructor_names:
  203. class_node = checker_utils.node_frame_class(node)
  204. if class_node is not None:
  205. class_doc = utils.docstringify(
  206. class_node.doc_node, self.linter.config.default_docstring_type
  207. )
  208. self.check_single_constructor_params(class_doc, node_doc, class_node)
  209. # __init__ or class docstrings can have no parameters documented
  210. # as long as the other documents them.
  211. node_allow_no_param = (
  212. class_doc.has_params()
  213. or class_doc.params_documented_elsewhere()
  214. or None
  215. )
  216. class_allow_no_param = (
  217. node_doc.has_params()
  218. or node_doc.params_documented_elsewhere()
  219. or None
  220. )
  221. self.check_arguments_in_docstring(
  222. class_doc, node.args, class_node, class_allow_no_param
  223. )
  224. self.check_arguments_in_docstring(
  225. node_doc, node.args, node, node_allow_no_param
  226. )
  227. def check_functiondef_returns(
  228. self, node: nodes.FunctionDef, node_doc: Docstring
  229. ) -> None:
  230. if (not node_doc.supports_yields and node.is_generator()) or node.is_abstract():
  231. return
  232. return_nodes = node.nodes_of_class(astroid.Return)
  233. if (node_doc.has_returns() or node_doc.has_rtype()) and not any(
  234. utils.returns_something(ret_node) for ret_node in return_nodes
  235. ):
  236. self.add_message("redundant-returns-doc", node=node, confidence=HIGH)
  237. def check_functiondef_yields(
  238. self, node: nodes.FunctionDef, node_doc: Docstring
  239. ) -> None:
  240. if not node_doc.supports_yields or node.is_abstract():
  241. return
  242. if (
  243. node_doc.has_yields() or node_doc.has_yields_type()
  244. ) and not node.is_generator():
  245. self.add_message("redundant-yields-doc", node=node)
  246. def visit_raise(self, node: nodes.Raise) -> None:
  247. func_node = node.frame(future=True)
  248. if not isinstance(func_node, astroid.FunctionDef):
  249. return
  250. # skip functions that match the 'no-docstring-rgx' config option
  251. no_docstring_rgx = self.linter.config.no_docstring_rgx
  252. if no_docstring_rgx and re.match(no_docstring_rgx, func_node.name):
  253. return
  254. expected_excs = utils.possible_exc_types(node)
  255. if not expected_excs:
  256. return
  257. if not func_node.doc_node:
  258. # If this is a property setter,
  259. # the property should have the docstring instead.
  260. property_ = utils.get_setters_property(func_node)
  261. if property_:
  262. func_node = property_
  263. doc = utils.docstringify(
  264. func_node.doc_node, self.linter.config.default_docstring_type
  265. )
  266. if self.linter.config.accept_no_raise_doc and not doc.exceptions():
  267. return
  268. if not doc.matching_sections():
  269. if doc.doc:
  270. missing = {exc.name for exc in expected_excs}
  271. self._add_raise_message(missing, func_node)
  272. return
  273. found_excs_full_names = doc.exceptions()
  274. # Extract just the class name, e.g. "error" from "re.error"
  275. found_excs_class_names = {exc.split(".")[-1] for exc in found_excs_full_names}
  276. missing_excs = set()
  277. for expected in expected_excs:
  278. for found_exc in found_excs_class_names:
  279. if found_exc == expected.name:
  280. break
  281. if any(found_exc == ancestor.name for ancestor in expected.ancestors()):
  282. break
  283. else:
  284. missing_excs.add(expected.name)
  285. self._add_raise_message(missing_excs, func_node)
  286. def visit_return(self, node: nodes.Return) -> None:
  287. if not utils.returns_something(node):
  288. return
  289. if self.linter.config.accept_no_return_doc:
  290. return
  291. func_node: astroid.FunctionDef = node.frame(future=True)
  292. # skip functions that match the 'no-docstring-rgx' config option
  293. no_docstring_rgx = self.linter.config.no_docstring_rgx
  294. if no_docstring_rgx and re.match(no_docstring_rgx, func_node.name):
  295. return
  296. doc = utils.docstringify(
  297. func_node.doc_node, self.linter.config.default_docstring_type
  298. )
  299. is_property = checker_utils.decorated_with_property(func_node)
  300. if not (doc.has_returns() or (doc.has_property_returns() and is_property)):
  301. self.add_message("missing-return-doc", node=func_node, confidence=HIGH)
  302. if func_node.returns:
  303. return
  304. if not (doc.has_rtype() or (doc.has_property_type() and is_property)):
  305. self.add_message("missing-return-type-doc", node=func_node, confidence=HIGH)
  306. def visit_yield(self, node: nodes.Yield | nodes.YieldFrom) -> None:
  307. if self.linter.config.accept_no_yields_doc:
  308. return
  309. func_node: astroid.FunctionDef = node.frame(future=True)
  310. # skip functions that match the 'no-docstring-rgx' config option
  311. no_docstring_rgx = self.linter.config.no_docstring_rgx
  312. if no_docstring_rgx and re.match(no_docstring_rgx, func_node.name):
  313. return
  314. doc = utils.docstringify(
  315. func_node.doc_node, self.linter.config.default_docstring_type
  316. )
  317. if doc.supports_yields:
  318. doc_has_yields = doc.has_yields()
  319. doc_has_yields_type = doc.has_yields_type()
  320. else:
  321. doc_has_yields = doc.has_returns()
  322. doc_has_yields_type = doc.has_rtype()
  323. if not doc_has_yields:
  324. self.add_message("missing-yield-doc", node=func_node, confidence=HIGH)
  325. if not (doc_has_yields_type or func_node.returns):
  326. self.add_message("missing-yield-type-doc", node=func_node, confidence=HIGH)
  327. visit_yieldfrom = visit_yield
  328. def _compare_missing_args(
  329. self,
  330. found_argument_names: set[str],
  331. message_id: str,
  332. not_needed_names: set[str],
  333. expected_argument_names: set[str],
  334. warning_node: nodes.NodeNG,
  335. ) -> None:
  336. """Compare the found argument names with the expected ones and
  337. generate a message if there are arguments missing.
  338. :param found_argument_names: argument names found in the docstring
  339. :param message_id: pylint message id
  340. :param not_needed_names: names that may be omitted
  341. :param expected_argument_names: Expected argument names
  342. :param warning_node: The node to be analyzed
  343. """
  344. potential_missing_argument_names = (
  345. expected_argument_names - found_argument_names
  346. ) - not_needed_names
  347. # Handle variadic and keyword args without asterisks
  348. missing_argument_names = set()
  349. for name in potential_missing_argument_names:
  350. if name.replace("*", "") in found_argument_names:
  351. continue
  352. missing_argument_names.add(name)
  353. if missing_argument_names:
  354. self.add_message(
  355. message_id,
  356. args=(", ".join(sorted(missing_argument_names)),),
  357. node=warning_node,
  358. confidence=HIGH,
  359. )
  360. def _compare_different_args(
  361. self,
  362. found_argument_names: set[str],
  363. message_id: str,
  364. not_needed_names: set[str],
  365. expected_argument_names: set[str],
  366. warning_node: nodes.NodeNG,
  367. ) -> None:
  368. """Compare the found argument names with the expected ones and
  369. generate a message if there are extra arguments found.
  370. :param found_argument_names: argument names found in the docstring
  371. :param message_id: pylint message id
  372. :param not_needed_names: names that may be omitted
  373. :param expected_argument_names: Expected argument names
  374. :param warning_node: The node to be analyzed
  375. """
  376. # Handle variadic and keyword args without asterisks
  377. modified_expected_argument_names: set[str] = set()
  378. for name in expected_argument_names:
  379. if name.replace("*", "") in found_argument_names:
  380. modified_expected_argument_names.add(name.replace("*", ""))
  381. else:
  382. modified_expected_argument_names.add(name)
  383. differing_argument_names = (
  384. (modified_expected_argument_names ^ found_argument_names)
  385. - not_needed_names
  386. - expected_argument_names
  387. )
  388. if differing_argument_names:
  389. self.add_message(
  390. message_id,
  391. args=(", ".join(sorted(differing_argument_names)),),
  392. node=warning_node,
  393. confidence=HIGH,
  394. )
  395. def _compare_ignored_args( # pylint: disable=useless-param-doc
  396. self,
  397. found_argument_names: set[str],
  398. message_id: str,
  399. ignored_argument_names: set[str],
  400. warning_node: nodes.NodeNG,
  401. ) -> None:
  402. """Compare the found argument names with the ignored ones and
  403. generate a message if there are ignored arguments found.
  404. :param found_argument_names: argument names found in the docstring
  405. :param message_id: pylint message id
  406. :param ignored_argument_names: Expected argument names
  407. :param warning_node: The node to be analyzed
  408. """
  409. existing_ignored_argument_names = ignored_argument_names & found_argument_names
  410. if existing_ignored_argument_names:
  411. self.add_message(
  412. message_id,
  413. args=(", ".join(sorted(existing_ignored_argument_names)),),
  414. node=warning_node,
  415. confidence=HIGH,
  416. )
  417. def check_arguments_in_docstring(
  418. self,
  419. doc: Docstring,
  420. arguments_node: astroid.Arguments,
  421. warning_node: astroid.NodeNG,
  422. accept_no_param_doc: bool | None = None,
  423. ) -> None:
  424. """Check that all parameters are consistent with the parameters mentioned
  425. in the parameter documentation (e.g. the Sphinx tags 'param' and 'type').
  426. * Undocumented parameters except 'self' are noticed.
  427. * Undocumented parameter types except for 'self' and the ``*<args>``
  428. and ``**<kwargs>`` parameters are noticed.
  429. * Parameters mentioned in the parameter documentation that don't or no
  430. longer exist in the function parameter list are noticed.
  431. * If the text "For the parameters, see" or "For the other parameters,
  432. see" (ignoring additional white-space) is mentioned in the docstring,
  433. missing parameter documentation is tolerated.
  434. * If there's no Sphinx style, Google style or NumPy style parameter
  435. documentation at all, i.e. ``:param`` is never mentioned etc., the
  436. checker assumes that the parameters are documented in another format
  437. and the absence is tolerated.
  438. :param doc: Docstring for the function, method or class.
  439. :type doc: :class:`Docstring`
  440. :param arguments_node: Arguments node for the function, method or
  441. class constructor.
  442. :type arguments_node: :class:`astroid.scoped_nodes.Arguments`
  443. :param warning_node: The node to assign the warnings to
  444. :type warning_node: :class:`astroid.scoped_nodes.Node`
  445. :param accept_no_param_doc: Whether to allow no parameters to be
  446. documented. If None then this value is read from the configuration.
  447. :type accept_no_param_doc: bool or None
  448. """
  449. # Tolerate missing param or type declarations if there is a link to
  450. # another method carrying the same name.
  451. if not doc.doc:
  452. return
  453. if accept_no_param_doc is None:
  454. accept_no_param_doc = self.linter.config.accept_no_param_doc
  455. tolerate_missing_params = doc.params_documented_elsewhere()
  456. # Collect the function arguments.
  457. expected_argument_names = {arg.name for arg in arguments_node.args}
  458. expected_argument_names.update(arg.name for arg in arguments_node.kwonlyargs)
  459. expected_argument_names.update(arg.name for arg in arguments_node.posonlyargs)
  460. not_needed_type_in_docstring = self.not_needed_param_in_docstring.copy()
  461. expected_but_ignored_argument_names = set()
  462. ignored_argument_names = self.linter.config.ignored_argument_names
  463. if ignored_argument_names:
  464. expected_but_ignored_argument_names = {
  465. arg
  466. for arg in expected_argument_names
  467. if ignored_argument_names.match(arg)
  468. }
  469. if arguments_node.vararg is not None:
  470. expected_argument_names.add(f"*{arguments_node.vararg}")
  471. not_needed_type_in_docstring.add(f"*{arguments_node.vararg}")
  472. if arguments_node.kwarg is not None:
  473. expected_argument_names.add(f"**{arguments_node.kwarg}")
  474. not_needed_type_in_docstring.add(f"**{arguments_node.kwarg}")
  475. params_with_doc, params_with_type = doc.match_param_docs()
  476. # Tolerate no parameter documentation at all.
  477. if not params_with_doc and not params_with_type and accept_no_param_doc:
  478. tolerate_missing_params = True
  479. # This is before the update of param_with_type because this must check only
  480. # the type documented in a docstring, not the one using pep484
  481. # See #4117 and #4593
  482. self._compare_ignored_args(
  483. params_with_type,
  484. "useless-type-doc",
  485. expected_but_ignored_argument_names,
  486. warning_node,
  487. )
  488. for index, arg_name in enumerate(arguments_node.args):
  489. if arguments_node.annotations[index]:
  490. params_with_type.add(arg_name.name)
  491. for index, arg_name in enumerate(arguments_node.kwonlyargs):
  492. if arguments_node.kwonlyargs_annotations[index]:
  493. params_with_type.add(arg_name.name)
  494. for index, arg_name in enumerate(arguments_node.posonlyargs):
  495. if arguments_node.posonlyargs_annotations[index]:
  496. params_with_type.add(arg_name.name)
  497. if not tolerate_missing_params:
  498. missing_param_doc = (expected_argument_names - params_with_doc) - (
  499. self.not_needed_param_in_docstring | expected_but_ignored_argument_names
  500. )
  501. missing_type_doc = (expected_argument_names - params_with_type) - (
  502. not_needed_type_in_docstring | expected_but_ignored_argument_names
  503. )
  504. if (
  505. missing_param_doc == expected_argument_names == missing_type_doc
  506. and len(expected_argument_names) != 0
  507. ):
  508. self.add_message(
  509. "missing-any-param-doc",
  510. args=(warning_node.name,),
  511. node=warning_node,
  512. confidence=HIGH,
  513. )
  514. else:
  515. self._compare_missing_args(
  516. params_with_doc,
  517. "missing-param-doc",
  518. self.not_needed_param_in_docstring
  519. | expected_but_ignored_argument_names,
  520. expected_argument_names,
  521. warning_node,
  522. )
  523. self._compare_missing_args(
  524. params_with_type,
  525. "missing-type-doc",
  526. not_needed_type_in_docstring | expected_but_ignored_argument_names,
  527. expected_argument_names,
  528. warning_node,
  529. )
  530. self._compare_different_args(
  531. params_with_doc,
  532. "differing-param-doc",
  533. self.not_needed_param_in_docstring,
  534. expected_argument_names,
  535. warning_node,
  536. )
  537. self._compare_different_args(
  538. params_with_type,
  539. "differing-type-doc",
  540. not_needed_type_in_docstring,
  541. expected_argument_names,
  542. warning_node,
  543. )
  544. self._compare_ignored_args(
  545. params_with_doc,
  546. "useless-param-doc",
  547. expected_but_ignored_argument_names,
  548. warning_node,
  549. )
  550. def check_single_constructor_params(
  551. self, class_doc: Docstring, init_doc: Docstring, class_node: nodes.ClassDef
  552. ) -> None:
  553. if class_doc.has_params() and init_doc.has_params():
  554. self.add_message(
  555. "multiple-constructor-doc",
  556. args=(class_node.name,),
  557. node=class_node,
  558. confidence=HIGH,
  559. )
  560. def _add_raise_message(
  561. self, missing_exceptions: set[str], node: nodes.FunctionDef
  562. ) -> None:
  563. """Adds a message on :param:`node` for the missing exception type.
  564. :param missing_exceptions: A list of missing exception types.
  565. :param node: The node show the message on.
  566. """
  567. if node.is_abstract():
  568. try:
  569. missing_exceptions.remove("NotImplementedError")
  570. except KeyError:
  571. pass
  572. if missing_exceptions:
  573. self.add_message(
  574. "missing-raises-doc",
  575. args=(", ".join(sorted(missing_exceptions)),),
  576. node=node,
  577. confidence=HIGH,
  578. )
  579. def register(linter: PyLinter) -> None:
  580. linter.register_checker(DocstringParameterChecker(linter))