Skip to content

S603 false positive on safe cmd #17112

Closed
@osauldmy

Description

@osauldmy

Summary

I have cmd as list of constant strings, not example with input() as S603 doc suggest to verify, but it still flags as untrusted.

import subprocess

git_diff = subprocess.run(["/usr/bin/git", "diff", "main", "--name-status"], check=True, capture_output=True)
$ ruff check --select S ~/ruff_bug.py
ruff_bug.py:3:12: S603 `subprocess` call: check for execution of untrusted input

Version

0.11.2

Metadata

Metadata

Assignees

Labels

help wantedContributions especially welcomeruleImplementing or modifying a lint rule

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions