astral-sh / ruff

An extremely fast Python linter and code formatter, written in Rust.
https://docs.astral.sh/ruff
MIT License
32.02k stars 1.07k forks source link

Support passing file content from stdin when `--add-noqa` is used #13155

Open InSyncWithFoo opened 1 month ago

InSyncWithFoo commented 1 month ago

Currently this treats - as a directory name:

$ ruff check --add-noqa -

The use case is editor integration, where a file might not be physically stored on the user's machine and/or saving to disk is (slightly) undesirable. IIRC, the language server also doesn't support this.

dhruvmanila commented 1 month ago

Seems reasonable to support.

IIRC, the language server also doesn't support this.

The language server does support it but in a limited manner as it's provided as a code action to add noqa comment to disable a single rule.

Screenshot 2024-08-30 at 13 39 39