Skip to content

WPS211: Ignore self and cls #2394

@JulianOrteil

Description

@JulianOrteil

What's wrong

For class methods and instance methods, WPS211 should not consider cls or self as these are not user-defined variables, but required variables by python.

How it should be

Ignore cls and self variables for class and instance methods. Depending on how robust you want to be, instead ignoring the first variable of these types of methods, regardless of name, might be preferrable.

Flake8 version and plugins

I use pre-commit for wemake, so hopefully the following is suitable:

- repo: https://github.com/PyCQA/flake8
  rev: 4.0.1
  hooks:
  - id: flake8
    additional_dependencies: [wemake-python-styleguide, nitpick]

pip information

pip --version:
pip 21.2.4

pip freeze:

altgraph==0.17.2
argon2-cffi==21.3.0
argon2-cffi-bindings==21.2.0
asttokens==2.0.5
attrs==21.4.0
backcall==0.2.0
beautifulsoup4==4.10.0
bleach==4.1.0
certifi==2021.10.8
cffi==1.15.0
cfgv==3.3.1
charset-normalizer==2.0.12
click==8.0.4
debugpy==1.5.1
decorator==5.1.1
defusedxml==0.7.1
diffimg==0.2.3
distlib==0.3.4
entrypoints==0.4
et-xmlfile==1.1.0
executing==0.8.3
filelock==3.6.0
identify==2.4.12
idna==3.3
imageio==2.9.0
ipykernel==6.9.2
ipython==8.1.1
ipython-genutils==0.2.0
ipywidgets==7.7.0
jedi==0.18.1
Jinja2==3.0.3
joblib==1.1.0
jsonschema==4.4.0
jupyter==1.0.0
jupyter-client==7.1.2
jupyter-console==6.4.3
jupyter-core==4.9.2
jupyterlab-pygments==0.1.2
jupyterlab-widgets==1.1.0
libusb1==3.0.0
loguru==0.6.0
MarkupSafe==2.1.1
matplotlib-inline==0.1.3
mistune==0.8.4
natsort==8.1.0
nbclient==0.5.13
nbconvert==6.4.4
nbformat==5.2.0
ndeflib==0.3.3
nest-asyncio==1.5.4
networkx==2.7.1
nfcpy==1.0.4
nltk==3.7
nodeenv==1.6.0
notebook==6.4.10
numpy==1.22.3
opencv-python==4.5.5.64
opencv-python-headless==4.5.4.60
openpyxl==3.0.9
packaging==21.3
pandas==1.4.1
pandocfilters==1.5.0
parso==0.8.3
pexpect==4.8.0
pickleshare==0.7.5
Pillow==9.0.1
platformdirs==2.5.1
pluggy==1.0.0
pre-commit==2.17.0
prometheus-client==0.13.1
prompt-toolkit==3.0.28
psutil==5.9.0
ptyprocess==0.7.0
pure-eval==0.2.2
py==1.11.0
pycparser==2.21
pyDes==2.0.1
Pygments==2.11.2
pyinstaller==4.10
pyinstaller-hooks-contrib==2022.2
pyparsing==3.0.7
pyrsistent==0.18.1
pyserial==3.5
PySide6==6.2.3
pytesseract==0.3.9
python-bidi==0.4.2
python-dateutil==2.8.2
pytz==2022.1
PyWavelets==1.3.0
PyYAML==6.0
pyzmq==22.3.0
qtconsole==5.2.2
QtPy==2.0.1
regex==2022.3.15
requests==2.27.1
scikit-image==0.19.2
scipy==1.8.0
Send2Trash==1.8.0
shiboken6==6.2.3
six==1.16.0
soupsieve==2.3.1
stack-data==0.2.0
terminado==0.13.3
testpath==0.6.0
tifffile==2022.3.16
toml==0.10.2
torch==1.11.0
torchvision==0.12.0
tornado==6.1
tox==3.24.5
tox-conda==0.9.2
tqdm==4.63.0
traitlets==5.1.1
trdg==1.6.0
typing_extensions==4.1.1
urllib3==1.26.9
virtualenv==20.13.3
wcwidth==0.2.5
webencodings==0.5.1
widgetsnbextension==3.6.0

OS information

Linux 5.13.0-35-generic
20.04.1-Ubuntu
x86_64

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions