refined-addition-53644
09/09/2022, 4:47 PMpyproject.toml
based config supported by bandit in pants? It doesn’t seem to work even when I explicitly provide the config file. 🧵refined-addition-53644
09/09/2022, 4:49 PM[tool.bandit]
skips = ["B101"]
• pants.toml
with explicit `pyproject.toml`as config
[bandit]
config = "pyproject.toml"
args = ["--quiet"]
lockfile = "build-support/bandit.lock"
extra_requirements.add = [
"tomli>=1.1.0",
]
./pants lint --only=bandit ::
18:46:20.08 [INFO] Initializing scheduler...
18:46:20.30 [INFO] Scheduler initialized.
18:46:24.33 [ERROR] Completed: Lint with Bandit - bandit failed (exit code 2).
[main] ERROR pyproject.toml : toml parser not available, reinstall with toml extra
18:46:24.33 [ERROR] Completed: Lint with Bandit - bandit failed (exit code 2).
[main] ERROR pyproject.toml : toml parser not available, reinstall with toml extra
18:46:24.37 [ERROR] Completed: Lint with Bandit - bandit failed (exit code 2).
[main] ERROR pyproject.toml : toml parser not available, reinstall with toml extra
refined-addition-53644
09/09/2022, 4:52 PMrhythmic-battery-45198
09/09/2022, 5:09 PMpyproject.toml
[tool.bandit]
exclude_dirs=[
'tests'
]
skips=[
'B403', # allow importing pickle
]
• pants.toml
[bandit]
version = "bandit[toml]>=1.7.0,<1.8"
lockfile = "3rdparty/python/bandit.lock"
config = "src/python/pyproject.toml"
Here is my working setup that I configured recently.refined-addition-53644
09/09/2022, 5:14 PMassert_used:
skips: ['*_test.py', 'test_*.py']
refined-addition-53644
09/09/2022, 5:16 PM[tool.bandit.assert_used]
skips = ['*_test.py', '*/test_*.py']
rhythmic-battery-45198
09/09/2022, 5:16 PM