Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] --with-tool overrides ALL run options in profile #447

Closed
okuuva opened this issue Sep 23, 2021 · 1 comment
Closed

[BUG] --with-tool overrides ALL run options in profile #447

okuuva opened this issue Sep 23, 2021 · 1 comment

Comments

@okuuva
Copy link

okuuva commented Sep 23, 2021

Documentation says the following about --tool and --with-tool command line flags:

To specify an exact list of tools to run, for example, only pylint and pep8:
prospector --tool pylint --tool pep8
Note that this command line option will override values set in profiles.
To specify optional extras on top of the defaults, for example, to run defaults and also pyroma without needing to specify the complete list of defaults:
prospector --with-tool pyroma

It does say that --tool will override values in profiles which absolutely makes sense. It doesn't say anything about --with-tool however and to me the behaviour is erratic as it overrides ALL run options in profile, not just the tool provided with the flag.

Let's say I have this in my .prospector.yml:

dodgy:
  run: false

mccabe:
  run: false

pylint:
  run: false

Now running prospector gives the following output:

> prospector
Check Information
=================
        Profiles: .prospector.yml, no_doc_warnings, no_member_warnings, no_test_warnings, strictness_medium, strictness_high, strictness_veryhigh
      Strictness: from profile
  Libraries Used: 
       Tools Run: pep8, profile-validator, pyflakes

But if I provide one --with-tool, e.g. --with-tool mypy, prospector runs every default tool:

> prospector --with-tool mypy
Check Information
=================
        Profiles: .prospector.yml, no_doc_warnings, no_member_warnings, no_test_warnings, strictness_medium, strictness_high, strictness_veryhigh
      Strictness: from profile
  Libraries Used:
       Tools Run: dodgy, mccabe, mypy, pep257, pep8, profile-validator, pyflakes, pylint

So on top of enabling all the default tools disabled in .prospector.yml it for some reason enabled pep257 as well!

Expected behavior
--with-tool to only add tools to the list defined by the profile, not completely override it.

Environment:

  • OS: macOS 10.15.7 (19H1417)
  • Tool: prospector itself
  • Prospector version: 1.5.1
  • Python version: 3.9.4
carlio added a commit that referenced this issue Feb 26, 2022
… run to defaults, instead of using values in profiles
@carlio
Copy link
Member

carlio commented Feb 26, 2022

Fixed this on the master branch, it'll go out in the 1.7.1 release

@carlio carlio closed this as completed Feb 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants