landscapeio / prospector

Inspects Python source files and provides information about type and location of classes, methods etc
GNU General Public License v2.0
1.94k stars 171 forks source link

[BUG] Prospector uses `exclude` option from setup.cfg and passes it to pylint resulting in an invalid option #525

Open mtirsel opened 1 year ago

mtirsel commented 1 year ago

Describe the bug Since version 1.7.1 prospector takes exclude option from various sections in setup.cfg and passes it to pylint resulting in:

pylint: error: ambiguous option: --exclude could match --exclude-protected, --exclude-too-few-public-methods

To Reproduce Steps to reproduce the behavior:

  1. Create and activate a new venv and run pip install prospector
  2. Create setup.cfg with any section (e.g. [foobar]) and place the option exclude = foo under it
  3. Call prospector without arguments
  4. See error

Expected behavior Prospector runs without the pylint error

Environment (please complete the following information):

Additional context When downgrading to prospector 1.7.0, it works as expected.

astroid==2.12.10
dill==0.3.5.1
dodgy==0.2.1
flake8==4.0.1
flake8-polyfill==1.0.2
isort==5.10.1
lazy-object-proxy==1.7.1
mccabe==0.6.1
pep8-naming==0.10.0
platformdirs==2.5.2
prospector==1.7.7
pycodestyle==2.8.0
pydocstyle==6.1.1
pyflakes==2.4.0
pylint==2.15.3
pylint-celery==0.3
pylint-django==2.5.3
pylint-flask==0.6
pylint-plugin-utils==0.7
PyYAML==6.0
requirements-detector==0.7
setoptconf-tmp==0.3.1
snowballstemmer==2.2.0
toml==0.10.2
tomli==2.0.1
tomlkit==0.11.5
wrapt==1.14.1
sdruskat commented 1 year ago

This is still the case in 1.8.4., where

[options.packages.find]
include = mypackage, mypackage.*

yields a misleading:

pylint: error: argument --include-naming-hint: (None, "Invalid yn value 'mypackage, mypackage.*', should be in ('y', 'true', 'yes', 'no', 'n', 'false')")