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