Skip to content
This repository has been archived by the owner on Nov 22, 2024. It is now read-only.

--bandit is ignored, plugin always runs, 'off by default' impossible #17

Open
wahuneke opened this issue Feb 21, 2020 · 1 comment
Open
Assignees
Labels
help wanted Extra attention is needed

Comments

@wahuneke
Copy link

I can find no way to configure pytest.ini so that we can have this plugin installed and configured but off by default. using addopts= -pno:bandit does disable the plugin as it should, but it is not possible to then turn it on again from command line (-pbandit or -ppytest_bandit, do not work).

It looks like the --bandit flag was supposed to activate this plugin - implying that it was intended to be off by default. It appears that flag actually does nothing. Not sure what is the right fix at this point since people may be using this and expecting the plugin to run automatically.

I suggest the solution is to change the meaning of the --bandit flag just a little bit. It should go from doing nothing to overriding the '--nobandit' flag. Then, add a --nobandit flag.

People like me will then be able to add --nobandit in pytest.ini and then have this overridden when we want to run from cmd line by adding --bandit

@wahuneke wahuneke changed the title --bandit is ignored, plugin always runs --bandit is ignored, plugin always runs, 'off by default' impossible Feb 21, 2020
@mattwwarren mattwwarren added the help wanted Extra attention is needed label Mar 3, 2020
@mattwwarren
Copy link
Contributor

I admit, my implementation of the config loading leaves a lot to be desired. I don't know how quickly I can get to this right now but it looks like I totally missed even checking for run_bandit in the execution of the plugin.

@mattwwarren mattwwarren self-assigned this Oct 9, 2020
mattwwarren pushed a commit that referenced this issue Oct 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
help wanted Extra attention is needed
Development

No branches or pull requests

2 participants