Skip to content

Commit 3496e06

Browse files
authored
Remove the check_docs extension and remove any references to it (#5730)
1 parent 8ad121f commit 3496e06

File tree

7 files changed

+14
-50
lines changed

7 files changed

+14
-50
lines changed

ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ Release date: TBA
1515

1616
Closes #5648
1717

18+
* Removed the deprecated ``check_docs`` extension. You can use the ``docparams`` checker
19+
to get the checks previously included in ``check_docs``.
20+
21+
Closes #5322
22+
1823
* Added several checkers to deal with unicode security issues
1924
(see `Trojan Sources <https://trojansource.codes/>`_ and
2025
`PEP 672 <https://www.python.org/dev/peps/pep-0672/>`_ for details) that also

doc/exts/pylint_extensions.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,6 @@
1414
from pylint.lint import PyLinter
1515
from pylint.utils import get_rst_title
1616

17-
# Some modules have been renamed and deprecated under their old names.
18-
# Skip documenting these modules since:
19-
# 1) They are deprecated, why document them moving forward?
20-
# 2) We can't load the deprecated module and the newly renamed module at the
21-
# same time without getting naming conflicts
22-
DEPRECATED_MODULES = ["check_docs"] # ==> docparams
23-
2417

2518
def builder_inited(app):
2619
"""Output full documentation in ReST format for all extension modules"""
@@ -34,7 +27,7 @@ def builder_inited(app):
3427
doc_files = {}
3528
for filename in os.listdir(ext_path):
3629
name, ext = os.path.splitext(filename)
37-
if name[0] == "_" or name in DEPRECATED_MODULES:
30+
if name[0] == "_":
3831
continue
3932
if ext == ".py":
4033
modules.append(f"pylint.extensions.{name}")

doc/whatsnew/2.13.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ New checkers
5959
Removed checkers
6060
================
6161

62+
* Removed the deprecated ``check_docs`` extension. You can use the ``docparams`` checker
63+
to get the checks previously included in ``check_docs``.
64+
65+
Closes #5322
66+
6267
Extensions
6368
==========
6469

pylint/extensions/check_docs.py

Lines changed: 0 additions & 25 deletions
This file was deleted.

pylint/lint/run.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -456,13 +456,7 @@ def cb_verbose_mode(self, *args, **kwargs):
456456
def cb_enable_all_extensions(self, option_name: str, value: None) -> None:
457457
"""Callback to load and enable all available extensions"""
458458
for filename in os.listdir(os.path.dirname(extensions.__file__)):
459-
# pylint: disable=fixme
460-
# TODO: Remove the check for deprecated check_docs after the extension has been removed
461-
if (
462-
filename.endswith(".py")
463-
and not filename.startswith("_")
464-
and not filename.startswith("check_docs")
465-
):
459+
if filename.endswith(".py") and not filename.startswith("_"):
466460
extension_name = f"pylint.extensions.{filename[:-3]}"
467461
if extension_name not in self._plugins:
468462
self._plugins.append(extension_name)

tests/extensions/test_check_docs_utils.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@
1212
# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
1313
# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE
1414

15-
"""Unit tests for the pylint checkers in :mod:`pylint.extensions.check_docs`,
16-
in particular the parameter documentation checker `DocstringChecker`
17-
"""
15+
"""Unit tests for utils functions in :mod:`pylint.extensions._check_docs_utils`."""
1816
import astroid
1917
import pytest
2018

tests/test_self.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1258,13 +1258,7 @@ def test_enable_all_extensions() -> None:
12581258
# Record all extensions
12591259
plugins = []
12601260
for filename in os.listdir(os.path.dirname(extensions.__file__)):
1261-
# pylint: disable=fixme
1262-
# TODO: Remove the check for deprecated check_docs after the extension has been removed
1263-
if (
1264-
filename.endswith(".py")
1265-
and not filename.startswith("_")
1266-
and not filename.startswith("check_docs")
1267-
):
1261+
if filename.endswith(".py") and not filename.startswith("_"):
12681262
plugins.append(f"pylint.extensions.{filename[:-3]}")
12691263

12701264
# Check if they are loaded

0 commit comments

Comments
 (0)