Error parsing pyproject.tml
Open
Nobody has claimed this yet.
bug
- Dominant language
- Python
- Stars
- 8.3k
- Forks
- 835
- Avg merge
- 5d 3h
- Merged PRs (30d)
- 1
Description
Describe the bug
Hi ! I'm following the documentation** to provide a custom setup for bandit to exclude some tests (B101) in our testing framework but I get the following error:
[config] ERROR expected '<document start>', but found '<scalar>'
in "pyproject.toml", line 2, column 1
[main] ERROR pyproject.toml : Error parsing file
Where the ppyproject.toml is the following
[tool.black]
line-length = 120
skip-string-normalization = true
skip-magic-trailing-comma = true
[tool.bandit.assert_used]
exclude = ["*_test.py", "test_*.py"]
**https://bandit.readthedocs.io/en/latest/config.html
Reproduction steps
1. bandit --recursive -c pyproject.toml test
Expected behavior
Not crash
Bandit version
1.7.0 (Default)
Python version
3.8
Additional context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the failure with the reported pyproject.toml and bandit --recursive -c pyproject.toml test command. Trace the configuration parsing entry point and verify that the shown Bandit settings are accepted without the parsing error and that the exclude patterns take effect.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli, security
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100