-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.nu
executable file
·47 lines (37 loc) · 963 Bytes
/
test.nu
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
43
44
45
46
47
#!/usr/bin/env nu
use root.nu
# This allows use to also run this file from different subdirectories as long as you are in the same git repository
let backend_dir = root backend_dir
def pytest_backend [] {
cd $backend_dir
poetry run pytest
}
def check_backend [] {
cd $backend_dir
poetry run black src tests
poetry run ruff src tests
print "Running mypy, this could take a while..."
poetry run mypy
}
def lint_fix [] {
cd $backend_dir
poetry run ruff src tests --fix
}
# Run pyest and run the formatter, linter and type checker
def "main backend" [] {
print "Testing and checking backend..."
pytest_backend
check_backend
}
# Run pytest on the backend
def "main pytest" [] {
print "Testing backend..."
pytest_backend
}
# Run pytest on the backend
def "main lint:fix" [] {
print "Linting and fixing issues..."
lint_fix
}
# important for the command to be exposed to the outside
def main [] {}