https://pantsbuild.org/ logo
#general
Title
# general
c

clean-night-52582

07/21/2021, 7:32 AM
Could we possibly get an option to hide bandit output on success? It will always print to stdout regardless of the process's exit code.
👍 1
c

curved-television-6568

07/21/2021, 7:40 AM
Would you like to create an issue for it on GitHub? https://github.com/pantsbuild/pants/issues That way it’ll be easier to track and plan etc. 🙂
❤️ 1
1
h

hundreds-father-404

07/21/2021, 8:07 AM
That's a good idea! Not very difficult to implement either If you'd be interested in contributing, I'd be happy to add instructions to that issue. I think it'd take no more than 20 lines or so (including a test). Either way, I agree with Andreas on creating an issue. -- Also it would be good to double check if Bandit already has a quiet option
h

happy-kitchen-89482

07/21/2021, 6:48 PM
There is prior art with the
--output
flag in the
test
goal
Is this something we'd want to do globally for all linters, or on a per-linter basis?
h

hundreds-father-404

07/21/2021, 6:50 PM
I think per-linter. Linter output is very helpful with Black for example. Super noisy with Bandit
c

clean-night-52582

07/22/2021, 5:34 PM
Bandit does have a quiet option
--quiet
which fixes this problem
h

hundreds-father-404

07/22/2021, 5:58 PM
Ah, great! Does --quiet silence error cases too much tho?
FYI you can set this in pants.toml [bandit] args = ["--quiet"]
c

clean-night-52582

07/23/2021, 3:42 PM
It does the correct thing with
--quiet
there is an option for
--silent
that will hide the errors.
Might be nice to put in the docs somewhere but doesn't seem to be a bandit page out side of the options.
h

hundreds-father-404

07/23/2021, 3:46 PM
Okay, great! Perhaps a "tip" toolbox on https://www.pantsbuild.org/v2.7/docs/python-linters-and-formatters? Or perhaps we've graduated to the point that we should have a section on that page like "Tool specific notes", and a subsection on Bandit. Wdyt?
6 Views