Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crash on pyproject.toml without bandit config #1073

Merged
merged 2 commits into from Dec 8, 2023

Conversation

javajawa
Copy link
Contributor

@javajawa javajawa commented Dec 3, 2023

This is a naive fix for bandit crashing when it encounters a pyproject.toml which does not contain any specific bandit configuration.

This resolves the common failure mode that is seen, but does not cause bandit to fall back to another configuration source if the pyproject.toml does not contain any tool.bandit block.

Resolves #1027

This is a naive fix for bandit crashing when it encounters a
`pyproject.toml` which does not contain any specific bandit
configuration.

This resolves the common failure mode that is seen, but does not cause
bandit to fall back to another configuration source if the
`pyproject.toml` does not contain any `tool.bandit` block.

Resolves PyCQA#1027
Copy link
Member

@ericwb ericwb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the newly changed line is wider than 80, thus failing the pep8 test.

bandit/core/config.py Outdated Show resolved Hide resolved
Copy link
Member

@ericwb ericwb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ericwb ericwb merged commit 0d35086 into PyCQA:main Dec 8, 2023
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Asking bandit to use pyproject.toml without a bandit config section causes exception
2 participants