[pyproject.toml] how to skip assert_used B101 only in test files #954
-
Hello, With assert_used:
skips:
- "*/*_test.py"
- "*/test_*.py" But I cannot find an example how to achieve that from [tool.bandit]
skips = ["B101"] |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
This might work, but I haven't tested it.
|
Beta Was this translation helpful? Give feedback.
-
import yaml
yaml_conf = '''
assert_used:
skips:
- "*/*_test.py"
- "*/test_*.py"
'''
|
Beta Was this translation helpful? Give feedback.
-
import tomli
toml_conf = '''
[tool.bandit.assert_used]
skips = ["*/*_test.py", "*/test_*.py"]
'''
|
Beta Was this translation helpful? Give feedback.
-
Can you share an example on how you achieved this using the bandit format or any other format! I am struggling with the exclusion using the latest release of bandit. |
Beta Was this translation helpful? Give feedback.
This might work, but I haven't tested it.