wemake-services / wemake-services/wemake-python-styleguide

Default values are not expanded for `:str:` role

Open
#3,787 6 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
2.9k
Forks
430
Avg merge
5h 14m
Merged PRs (30d)
34

Description

This is the output I see for WPS211:

» wps explain WPS211
WPS211 — Forbid too many arguments for a function or method.

Reasoning:
    This is an indicator of a bad design. When a function requires many
    arguments it is a sign that it should be refactored.
    It also indicates that the function does too many things at once.

Solution:
    Split the function into several functions.
    Then it will be easier to use them.

Configuration:
    This rule is configurable with ``--max-arguments``.
    Default: :str:`wemake_python_styleguide.options.defaults.MAX_ARGUMENTS`

.. versionadded:: 0.1.0
.. versionchanged:: 1.0.0
   Does not count special ``self``, ``cls``, and ``mcs`` as parameters.

   Also does not count parameters in ``@overload`` definitions.

See at website: https://pyflak.es/WPS211
                                        

Note that

:str:`wemake_python_styleguide.options.defaults.MAX_ARGUMENTS`

is not expanded to be 5 https://github.com/wemake-services/wemake-python-styleguide/blob/664e75ce51cb2988cf69864e631f61cacb3a2794/wemake_python_styleguide/options/defaults.py#L75

But, it must be, right now both humans and LLMs will struggle with this.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the wps explain WPS211 entry point and inspect how the Configuration section renders the :str: role, then compare it with wemake_python_styleguide/options/defaults.py where MAX_ARGUMENTS is defined. Done means the output expands the reference to the default value 5 instead of showing the unresolved role, with the existing explanation output still intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, documentation
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.