Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/scala/codacy/bandit/Bandit.scala
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ object Bandit extends Tool {
}
// 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.

private def runTool(
rootPath: Source.Directory,
Expand Down