consider this minimal example
#!/usr/bin/python3 target = None if target != None: print ("target's not none")
if the file that contains the script has a .py extension it will display the following

and if i remove the .py extension ,no warnings will display nor file can be formatted even though vscode detects
that it's a python file.
ruff version: 0.5.5
Python version: 3.12.4
vscode version: 1.91.1
OS: archlinux