mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-14 08:24:46 +00:00
deprecate --include-in-doctest --exclude-from-doctest
This commit is contained in:
parent
80e6cdf55f
commit
4778fe9643
1 changed files with 9 additions and 0 deletions
|
|
@ -3,6 +3,7 @@ from __future__ import annotations
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import ast
|
import ast
|
||||||
|
import logging
|
||||||
import os
|
import os
|
||||||
from typing import Any
|
from typing import Any
|
||||||
from typing import Generator
|
from typing import Generator
|
||||||
|
|
@ -12,6 +13,8 @@ import pyflakes.checker
|
||||||
from flake8 import utils
|
from flake8 import utils
|
||||||
from flake8.options.manager import OptionManager
|
from flake8.options.manager import OptionManager
|
||||||
|
|
||||||
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
FLAKE8_PYFLAKES_CODES = {
|
FLAKE8_PYFLAKES_CODES = {
|
||||||
"UnusedImport": "F401",
|
"UnusedImport": "F401",
|
||||||
"ImportShadowedByLoopVar": "F402",
|
"ImportShadowedByLoopVar": "F402",
|
||||||
|
|
@ -137,6 +140,12 @@ class FlakesChecker(pyflakes.checker.Checker):
|
||||||
cls.builtIns = cls.builtIns.union(options.builtins)
|
cls.builtIns = cls.builtIns.union(options.builtins)
|
||||||
cls.with_doctest = options.doctests
|
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 = []
|
included_files = []
|
||||||
for included_file in options.include_in_doctest:
|
for included_file in options.include_in_doctest:
|
||||||
if included_file == "":
|
if included_file == "":
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue