Add ruff.__main__ wrapper to allow invocation as ‘python -m ruff’ (#687)

This commit is contained in:
Anders Kaseorg
2022-11-11 12:53:42 -08:00
committed by GitHub
parent bf7bf7aa17
commit 5113ded22a
2 changed files with 7 additions and 0 deletions

0
ruff/__init__.py Normal file
View File

7
ruff/__main__.py Normal file
View File

@@ -0,0 +1,7 @@
import os
import sys
import sysconfig
if __name__ == "__main__":
ruff = os.path.join(sysconfig.get_path("scripts"), "ruff")
os.spawnv(os.P_WAIT, ruff, [ruff, *sys.argv[1:]])