Description
Question
Could the documentation be made more helpful for people trying to ignore dummy arguments?
Documentation for future user
Suppose that I'm looking to suppress unused-argument
for all function arguments starting with "mock_".
I might find the option --dummy-variables-rgx
:
A regular expression matching the name of dummy variables (i.e. expected to not be used). (default: _+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_)
But wait, it doesn't work. Even though arguments are variables.
I might then find the option --ignored-argument-names
:
Argument names that match this expression will be ignored. (default: re.compile('_.*|^ignored_|^unused_'))
The default value looks promising. But wait, why isn't it named --dummy-arguments-rgx
? And why is the documentation so different? Is it because this is actually going to suppress a bunch of messages other than unused-variable
, such as invalid_name
? What does it actually do? Even regular maintainers are confused.
Eventually I learn that it will (at least) suppress unused-variable
, too-many-args
, and some docstring message(s).
My suggestion is to
- clarify that
--dummy-variables-rgx
will not work for dummy arguments and point the user towards--ignored-argument-names
, and - make the documentation of
--ignored-argument-names
clear about what it actually does (what messages it might suppress).
Additional context
No response