Skip to content

Commit fb767c0

Browse files
committed
chore: add Codacy config to skip B101 in test files
Bandit B101 ('Use of assert detected') is a well-known false positive for pytest test files where assert is the standard assertion mechanism. Exclude the tests/ directory from Bandit analysis to prevent 32 false positives on PR #179.
1 parent 3788a5e commit fb767c0

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

.codacy.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
# Codacy configuration: https://docs.codacy.com/repositories-configure/codacy-configuration-file/
3+
engines:
4+
bandit:
5+
# B101: "Use of assert detected" — assert is standard in pytest test files.
6+
# Bandit warns that `assert` statements are removed when running with -O,
7+
# but test files are never run in optimized mode. Skip this rule for tests.
8+
exclude_paths:
9+
- "tests/**"

0 commit comments

Comments
 (0)