-
Notifications
You must be signed in to change notification settings - Fork 177
Expand file tree
/
Copy pathlint_custom_code.sh
More file actions
executable file
·42 lines (37 loc) · 1.21 KB
/
lint_custom_code.sh
File metadata and controls
executable file
·42 lines (37 loc) · 1.21 KB
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
38
39
40
41
42
#!/usr/bin/env bash
ERRORS=0
echo "Running mypy..."
# TODO: Uncomment once the examples are fixed
# uv run mypy examples/ || ERRORS=1
echo "-> running on extra"
uv run mypy src/mistralai/extra/ || ERRORS=1
echo "-> running on hooks"
uv run mypy src/mistralai/_hooks/ \
--exclude __init__.py --exclude sdkhooks.py --exclude types.py || ERRORS=1
echo "-> running on scripts"
uv run mypy scripts/ || ERRORS=1
echo "Running pyright..."
# TODO: Uncomment once the examples are fixed
# uv run pyright examples/ || ERRORS=1
echo "-> running on extra"
uv run pyright src/mistralai/extra/ || ERRORS=1
echo "-> running on hooks"
uv run pyright src/mistralai/_hooks/ || ERRORS=1
echo "-> running on scripts"
uv run pyright scripts/ || ERRORS=1
echo "Running ruff..."
echo "-> running on examples"
uv run ruff check examples/ || ERRORS=1
echo "-> running on extra"
uv run ruff check src/mistralai/extra/ || ERRORS=1
echo "-> running on hooks"
uv run ruff check src/mistralai/_hooks/ \
--exclude __init__.py --exclude sdkhooks.py --exclude types.py || ERRORS=1
echo "-> running on scripts"
uv run ruff check scripts/ || ERRORS=1
if [ "$ERRORS" -ne 0 ]; then
echo "❌ One or more linters failed"
exit 1
else
echo "✅ All linters passed"
fi