We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
ruff
1 parent 741779a commit 783d649Copy full SHA for 783d649
‎tool/_ruff.py
@@ -1,10 +1,16 @@
1
import subprocess
2
from pathlib import Path
3
+from typing import TYPE_CHECKING
4
-# see https://github.com/astral-sh/ruff/pull/18224
5
-from ruff.__main__ import ( # type: ignore[import-untyped] # pyright: ignore[reportMissingTypeStubs]
6
- find_ruff_bin, # noqa: PLC2701
7
-)
+if TYPE_CHECKING:
+ # ruff should be optional during type-checking
+ def find_ruff_bin() -> str: ...
8
+
9
+else:
10
+ # see https://github.com/astral-sh/ruff/pull/18224
11
+ from ruff.__main__ import ( # type: ignore[import-untyped]
12
+ find_ruff_bin, # noqa: PLC2701
13
+ )
14
15
16
def ruff_format(source: str) -> str:
0 commit comments