mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-04 19:12:29 +00:00
Split check and fmt tools
This commit is contained in:
22
tools/fmt.py
Normal file
22
tools/fmt.py
Normal file
@@ -0,0 +1,22 @@
|
||||
"""
|
||||
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()
|
Reference in New Issue
Block a user