-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathjustfile
80 lines (68 loc) · 1.74 KB
/
justfile
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# Lists all targets
[private]
default:
@just --list
# Builds the docker container for the specified platform
[group('build')]
build-image platform:
docker buildx build \
-f docker/Dockerfile \
--platform {{ platform }} \
.
# Run `hadolint` on all `Dockerfile`s
[group('lint')]
hadolint:
#!/usr/bin/env bash
set -eou pipefail
find . -type f -name "Dockerfile*" | while read -r file; do
echo -n "Running \`hadolint\` on ${file}..."
hadolint ${file}
echo "{{ BOLD + GREEN }}OK{{ NORMAL }}"
done
# Check `just` syntax
[group('lint')]
just-check:
#!/usr/bin/env bash
set -eou pipefail
find . -type f -name "justfile" | while read -r file; do
echo -n "Running \`just --fmt --check\` on ${file}..."
just --unstable --fmt --check -f ${file}
echo "{{ BOLD + GREEN }}OK{{ NORMAL }}"
done
# Fixes `just` syntax
[group('format')]
[group('lint')]
just-format:
#!/usr/bin/env bash
set -eou pipefail
find . -type f -name "justfile" | while read -r file; do
echo "Running \`just --fmt\` on ${file}..."
just --unstable --fmt -f ${file}
done
# Runs all linters
lint: hadolint just-check just-format pyright renovate-validate ruff-check ruff-format yamllint
# Check Python code with Pyright
[group('lint')]
pyright:
pyright
# Run pytest tests
[group('test')]
pytest:
@pytest
# Validate `renovate.json` file
[group('lint')]
renovate-validate:
renovate-config-validator
# Check Python code with Ruff
[group('lint')]
ruff-check:
ruff check . --diff
# Check Python code formatting with Ruff
[group('format')]
[group('lint')]
ruff-format:
ruff format . --diff
# Check YAML files with yamllint
[group('lint')]
yamllint:
yamllint .