{
"platform": {
"python_implementation": "CPython",
"python_version": "3.12.10",
"system": "Linux"
},
"plugins": [
{
"plugin": "darglint",
"version": "1.8.1"
},
{
"plugin": "flake8-annotations",
"version": "3.1.1"
},
{
"plugin": "flake8-bugbear",
"version": "24.12.12"
},
{
"plugin": "flake8-builtins",
"version": "2.5.0"
},
{
"plugin": "flake8-class-attributes-order",
"version": "0.3.0"
},
{
"plugin": "flake8-comprehensions",
"version": "3.16.0"
},
{
"plugin": "flake8-docstrings",
"version": "1.7.0"
},
{
"plugin": "flake8-eradicate",
"version": "1.5.0"
},
{
"plugin": "flake8-executable",
"version": "2.1.3"
},
{
"plugin": "flake8-functions",
"version": "0.0.8"
},
{
"plugin": "flake8_cognitive_complexity",
"version": "0.1.0"
},
{
"plugin": "mccabe",
"version": "0.7.0"
},
{
"plugin": "pep8-naming",
"version": "0.14.1"
},
{
"plugin": "pycodestyle",
"version": "2.13.0"
},
{
"plugin": "pyflakes",
"version": "3.3.2"
},
{
"plugin": "wemake-python-styleguide",
"version": "1.1.0"
}
],
"version": "7.2.0"
}
pip 25.1.1 from /usr/local/lib/python3.12/site-packages/pip (python 3.12)
amqp==5.3.1
annotated-types==0.7.0
anyio==4.9.0
attrs==25.3.0
billiard==4.2.1
black==25.1.0
blinker==1.9.0
build==1.2.2.post1
celery==5.5.2
certifi==2025.1.31
chardet==5.2.0
charset-normalizer==3.4.1
Chunking==0.0.2
click==8.1.8
click-didyoumean==0.3.1
click-plugins==1.1.1
click-repl==0.3.0
cognitive_complexity==1.3.0
coloredlogs==15.0.1
darglint==1.8.1
eradicate==2.3.0
fastembed==0.5.1
filelock==3.18.0
flake8==7.2.0
flake8-annotations==3.1.1
flake8-bugbear==24.12.12
flake8-builtins==2.5.0
flake8-class-attributes-order==0.3.0
flake8-comprehensions==3.16.0
flake8-docstrings==1.7.0
flake8-eradicate==1.5.0
flake8-executable==2.1.3
flake8-functions==0.0.8
flake8_cognitive_complexity==0.1.0
Flask==3.1.0
flask-redis==0.4.0
flatbuffers==25.2.10
fsspec==2025.3.0
grpcio==1.71.0
grpcio-tools==1.71.0
h11==0.14.0
h2==4.2.0
hpack==4.1.0
httpcore==1.0.7
httpx==0.28.1
huggingface-hub==0.29.3
humanfriendly==10.0
hyperframe==6.1.0
idna==3.10
itsdangerous==2.2.0
Jinja2==3.1.6
kaleido==0.2.1
kombu==5.5.3
loguru==0.7.3
MarkupSafe==3.0.2
mccabe==0.7.0
mmh3==4.1.0
mpmath==1.3.0
mr-proper==0.0.7
mypy-extensions==1.0.0
narwhals==1.32.0
nodeenv==1.9.1
numpy==2.2.4
onnxruntime==1.21.0
packaging==24.2
pandas==2.2.3
pathlib==1.0.1
pathspec==0.12.1
pep8-naming==0.14.1
pillow==10.4.0
pip-tools==7.4.1
platformdirs==4.3.7
plotly==6.0.1
portalocker==2.10.1
prompt_toolkit==3.0.51
protobuf==5.29.4
py_rust_stemmers==0.1.5
pycodestyle==2.13.0
pydantic==2.10.6
pydantic_core==2.27.2
pydocstyle==6.3.0
pyflakes==3.3.2
Pygments==2.19.1
PyJWT==2.9.0
pyproject_hooks==1.2.0
pyright==1.1.398
python-dateutil==2.9.0.post0
pytz==2025.2
PyYAML==6.0.2
qdrant-client==1.13.3
redis==5.3.0
requests==2.32.3
requests-toolbelt==1.0.0
setuptools==80.4.0
six==1.17.0
sniffio==1.3.1
snowballstemmer==2.2.0
stdlib-list==0.11.1
sympy==1.13.3
tokenizers==0.21.1
tqdm==4.67.1
typing_extensions==4.13.0
tzdata==2025.2
urllib3==2.3.0
vine==5.1.0
wcwidth==0.2.13
wemake-python-styleguide==1.1.0
Werkzeug==3.1.3
wheel==0.45.1
Linux 089052fc5b28 5.15.167.4-microsoft-standard-WSL2 #1 SMP Tue Nov 5 00:21:55 UTC 2024 x86_64 GNU/Linux
What's wrong
In the above definition
WPS212forfoobaris being triggered because 3returnstatements are being counted. However, the function only has a singlereturn. The statements of the inner function and class method definitions are being counted as well.How it should be
WPS212should ignore inner definitions of functions and classes when countingreturnstatements. Selectivelynoqaing inner definitions with their ownreturnstatements is currently impossible ifWPS212has to be enforced.Flake8 version and plugins
pip information
OS information
Devcontainer under WSL based on
python:3.12-slimdocker image.