From 4778fe9643e94123f93a306f1ed63b52323eee35 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Wed, 14 Dec 2022 13:25:35 -0500 Subject: [PATCH] deprecate --include-in-doctest --exclude-from-doctest --- src/flake8/plugins/pyflakes.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/flake8/plugins/pyflakes.py b/src/flake8/plugins/pyflakes.py index a9dbc4c..f165c95 100644 --- a/src/flake8/plugins/pyflakes.py +++ b/src/flake8/plugins/pyflakes.py @@ -3,6 +3,7 @@ from __future__ import annotations import argparse import ast +import logging import os from typing import Any from typing import Generator @@ -12,6 +13,8 @@ import pyflakes.checker from flake8 import utils from flake8.options.manager import OptionManager +LOG = logging.getLogger(__name__) + FLAKE8_PYFLAKES_CODES = { "UnusedImport": "F401", "ImportShadowedByLoopVar": "F402", @@ -137,6 +140,12 @@ class FlakesChecker(pyflakes.checker.Checker): cls.builtIns = cls.builtIns.union(options.builtins) cls.with_doctest = options.doctests + if options.include_in_doctest or options.exclude_from_doctest: + LOG.warning( + "--include-in-doctest / --exclude-from-doctest will be " + "removed in a future version. see PyCQA/flake8#1747" + ) + included_files = [] for included_file in options.include_in_doctest: if included_file == "":