-
Notifications
You must be signed in to change notification settings - Fork 0
/
justfile
51 lines (37 loc) · 1.73 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
#!/usr/bin/env -S just --justfile
# See https://github.com/casey/just for the just command and format explanation
# List all available recipes
_default:
@just --list --unsorted --justfile {{ justfile() }} --list-prefix '····'
# Update this list of files as necessary
docker_files := "*/Dockerfile*"
markdown_files := "*.md"
python_files := "*/*.py */tests/*.py"
yaml_files := ".github/*/*.yml"
# Do you prefer Docker or Podman?
container_tool := "podman"
# format Markdown, YAML and Python files
fmt:
prettier --write -- {{ markdown_files }} {{ yaml_files }}
isort --settings-path .github/linters/.isort.cfg -- {{ python_files }}
black -- {{ python_files }}
# lint Markdown, YAML, Dockerfiles and Python files
lint:
hadolint --config .github/linters/.hadolint.yaml -- {{ docker_files }}
yamllint --config-file .github/linters/.yaml-lint.yml -- {{ yaml_files }}
markdownlint --config .github/linters/.markdown-lint.yml -- {{ markdown_files }}
prettier --check -- {{ markdown_files }} {{ yaml_files }}
flake8 --config .github/linters/.flake8 -- {{ python_files }}
mypy --config-file .github/linters/.mypy.ini -- {{ python_files }}
isort --settings-path .github/linters/.isort.cfg --check --diff -- {{ python_files }}
black --check --fast --diff --color -- {{ python_files }}
pylint --rcfile .github/linters/.python-lint -- {{ python_files }}
# test Python files
test:
cd server && python -m unittest tests/*.py
# run the server application in Docker
serve PORT:
{{ container_tool }} run -it -p {{ PORT }}:5501 `{{ container_tool }} build -q server`
# run benchmarks against the service
benchmark URL:
client/benchmark.py --url {{ URL }} -j 64 -o benchmark.errors.tsv -- data/atis/test.tsv