Given the following file named foo.pyi:
from pathlib import Path
def get_home_directory() -> Path: ...
ruff reports different errors depending on whether it's being parsed from stdin. The following reports no errors:
ruff --force-exclude --no-cache --no-fix --quiet --format json --isolated --select TCH asyncpg-stubs/compat.pyi
And the following reports an error in the first line:
cat foo.pyi | ruff --force-exclude --no-cache --no-fix --quiet --format json --isolated --select TCH --stdin-filename path/to/foo.pyi -
The reason this is coming up is because ruff-lsp runs ruff similar to how the second command runs and is reporting errors in my stubs project.