Repository navigation
[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"] |
Answered by
mportesdev
Oct 24, 2022
Replies: 4 comments 2 replies
|
This might work, but I haven't tested it. |
2 replies
Answer selected by
copdips
import yaml
yaml_conf = '''
assert_used:
skips:
- "*/*_test.py"
- "*/test_*.py"
''' |
0 replies
import tomli
toml_conf = '''
[tool.bandit.assert_used]
skips = ["*/*_test.py", "*/test_*.py"]
''' |
0 replies
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. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This might work, but I haven't tested it.