Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

404
Visualizações
Bandit Issue with Pyproject.toml

I'm trying to use pyproject.toml to exclude the venv/ directory. But it is not recognising the option.

[tool.bandit]
exclude = "/venv"

[tool.black]
exclude = "(venv)"

[tool.isort]
profile = "black"
skip = "venv"
balanced_wrapping = true
atomic = true

If I use the CLI option like so:

$ bandit -v -r . --exclude "/venv"

the directory is excluded. But if I just run bandit, it doesn't exclude the directory even though I have it in the pyproject.toml.

My bandit version is: 1.7.1.

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

exclude did not work for me, so I looked through official docs and found this:

enter image description here

We can specify dirs (and files as well) that we want to exclude in a list format

pyproject.toml:

[tool.bandit]
exclude_dirs = ["venv",]

From this documentation:

"Also you can configure bandit via pyproject.toml file. In this case you would explicitly specify the path to configuration via -c too."

Therefore, CLI option would look like this:

bandit -v -r . -c "pyproject.toml"

(will work without quotes as well)


enter image description here


I've never used bandit before, so if I got your question wrong - please feel free to write back, we will figure that out :D

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda