Skip to content

feat: Support pyproject.toml as configuration file#76

Merged
heliocodacy merged 1 commit intomasterfrom
add-support-for-pyproject-toml
Feb 12, 2026
Merged

feat: Support pyproject.toml as configuration file#76
heliocodacy merged 1 commit intomasterfrom
add-support-for-pyproject-toml

Conversation

@heliocodacy
Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings February 12, 2026 16:52
@codacy-production
Copy link
Copy Markdown

Codacy's Analysis Summary

0 new issue (≤ 1 medium issue)
0 new security issue (≤ 0 issue)
0 complexity
0 duplications

Review Pull Request in Codacy →

AI Reviewer available: add the codacy-review label to get contextual insights without leaving GitHub.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds support for using pyproject.toml as a Bandit configuration source, aligning the tool wrapper with Bandit’s supported config file locations/formats.

Changes:

  • Extend the autodetected config filename list to include pyproject.toml.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

// https://bandit.readthedocs.io/en/latest/config.html
private lazy val nativeIniFileNames = Set(".bandit", "bandit.ini")
private lazy val nativeConfigFileNames = Set("bandit.yml", "bandit.yaml", "bandit.toml")
private lazy val nativeConfigFileNames = Set("bandit.yml", "bandit.yaml", "bandit.toml", "pyproject.toml")
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

nativeConfigFileNames is a Set, but the code later uses collectFirst over it to pick a single config file. Since Set iteration order is not guaranteed, the selected config becomes non-deterministic when multiple config files are present (and adding pyproject.toml increases the chance of this). Consider using an ordered collection (e.g., List) with an explicit precedence order, and then collectFirst/find over that list.

Copilot uses AI. Check for mistakes.
@heliocodacy heliocodacy merged commit a3145cc into master Feb 12, 2026
10 checks passed
@heliocodacy heliocodacy deleted the add-support-for-pyproject-toml branch February 12, 2026 17:01
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.

3 participants