Pre-commit hook fails: "unknown test found in profile"; Manual run from same config works.
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 67/100
Direzione di ricerca
Start by tracing how the Bandit pre-commit hook loads pyproject.toml and handles the skips setting; compare that path with the manual bandit -c pyproject.toml -r . invocation. Reproduce with the provided configuration and Bandit 1.9.1, then check the hook against the expected behavior: it should run successfully with the same config as the manual command.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the bug
In a project where bandit -c pyproject.toml runs without finding any problems, your pre-commit hook falls over a skips line in the TOML file.
Reproduction steps
% sed -ne '/tool.bandit/,$p' pyproject.toml
[tool.bandit]
exclude_dirs = ['.direnv']
skips = ["B106"] # do not check for hardcoded passwords anywhere
[tool.bandit.assert_used]
skips = ['*/tests/**.py', '*/integration/**.py']
% bandit -q -c pyproject.toml -r .
% echo Yay, no errors!
Yay, no errors!
% sed -ne '/bandit/,$p' .pre-commit-config.yaml
- repo: https://github.com/PyCQA/bandit
rev: 1.7.9
hooks:
- id: bandit
args: ["-c", "pyproject.toml"] # same invocation as above!
% pre-commit run bandit --all-files
bandit...................................................................Failed
- hook id: bandit
- exit code: 2
[main] INFO profile include tests: None
[main] INFO profile exclude tests: B106
[main] INFO cli include tests: None
[main] INFO cli exclude tests: None
[main] ERROR Unknown test found in profile: B106
Expected behavior
I'd expect the pre-commit run to be identical to the manual one.
Bandit version
1.9.1 (Default)
Python version
3.14 (Default)
Additional context
Bandit 1.9.4
- Lingua principale
- Python
- Stelle
- 8.4k
- Fork
- 893
- Merge medio
- 6h 52m
- PR unite (30g)
- 3
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di PyCQA/bandit
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 85/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
Turn off progress bar in CIForse già presa @silvatechf l’ha presa 28 giorni fa. Apertaenhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
-
`bandit -ii -ll -ii -ll` raises an `IndexError`Forse già presa @botbikamordehai2-sketch l’ha presa 181 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
Tutte le issue di PyCQA/bandit
Issue simili
-
🧫10장-투향
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
hyunjimoon/golden-cage-book#188 ·
-
agent/scanner bug stage/010-actionable
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
torch-spyre/spyre-inference#1812 ·
I maintainer di solito rispondono entro 1 giorno
-
Bug: fenced drafts inside <think> tags break parsing or are returned instead of the answerForse già presa @aad1tyaaaaa l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
google/langextract#639 ·
I maintainer di solito rispondono entro 1 giorno
-
[oblt-aw][autodoc] Update autodoc routing docs for relative in-repo lock usesForse già presa @github-actions l’ha presa oggi. Aperta
Difficoltà 1/5 1-3 ore Idoneità per principianti 87/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno