2
0
mirror of https://github.com/LonamiWebs/Telethon synced 2025-08-24 19:08:00 +00:00
telethon/tools/fmt.py

23 lines
421 B
Python
Raw Normal View History

2023-09-13 20:15:49 +02:00
"""
Sort imports and format code.
"""
import subprocess
import sys
BLACK_IGNORE = r"tl/(abcs|functions|types)/\w+.py"
def run(*args: str) -> int:
return subprocess.run((sys.executable, "-m", *args)).returncode
def main() -> None:
exit(
run("isort", ".", "--profile", "black", "--gitignore")
or run("black", ".", "--extend-exclude", BLACK_IGNORE)
)
if __name__ == "__main__":
main()