forked from zulip/zulip-terminal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlint-all
executable file
·37 lines (28 loc) · 992 Bytes
/
lint-all
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env python3
import subprocess
import sys
from python_tools import lintable_tools_files
python_sources = [
"zulipterminal/",
"tests/",
"setup.py",
]
python_sources += lintable_tools_files
tools = {
"PEP8 & more (ruff)": ["ruff"] + python_sources,
"Formatting (black)": ["black", "--check"] + python_sources,
"Import order (isort)": "./tools/run-isort-check",
"Type consistency (mypy)": "./tools/run-mypy",
"Common spelling mistakes": "./tools/run-spellcheck",
"Hotkey linting & docs sync check": ["./tools/lint-hotkeys"],
"Docstring linting & docs sync check (lint-docstring)": "./tools/lint-docstring",
}
HEADER = 80 * "="
SUBHEADER = 80 * "-"
for tool_name, command in tools.items():
print(f"{HEADER}\n{tool_name}\n{SUBHEADER}", flush=True)
result = subprocess.call(command, stderr=subprocess.STDOUT)
if result != 0:
print(f"{HEADER}\nLINTING FAILED")
sys.exit(1)
print(f"{HEADER}\nLINTING SUCCESSFUL")