-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
78 lines (63 loc) · 2.22 KB
/
Makefile
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
CI := $(if $(CI),yes,no)
SHELL := /bin/bash
ifeq ($(CI), yes)
POETRY_OPTS = "-v"
PRE_COMMIT_OPTS = --show-diff-on-failure --verbose
endif
fix: run-pre-commit ## run all automatic fixes
fix-md: ## automatically fix markdown format errors
@poetry run pre-commit run mdformat --all-files
lint: ## run all linters
@if [ $${CI} ]; then \
echo ""; \
echo "skipped linters that have dedicated jobs"; \
else \
echo ""; \
$(MAKE) --no-print-directory lint-docker lint-shellcheck; \
fi
# for more info: https://github.com/hadolint/hadolint
lint-docker: ## lint Dockerfile
@echo "Running hadolint..."
@if [[ $$(command -v hadolint) ]]; then \
find ./vscode -name "*Dockerfile*" -type f | \
xargs hadolint; \
else \
echo "hadolint not installed - install it to lint Dockerfiles"; \
echo " - macOS: brew install hadolint"; \
fi
@echo ""
lint-shellcheck: ## lint shell scripts using shellcheck
@echo "Running shellcheck..." && \
bash ./tests/shellcheck.sh && \
echo ""
permissions: ## set script permissions
@find ./vscode/rootfs/etc/s6-overlay/s6-rc.d -type f \( -name run -or -name finish \) -prune -exec chmod +x {} \;
@find ./vscode/rootfs/usr/local/bin -type f -prune -exec chmod +x {} \;
run-pre-commit: ## run pre-commit for all files
@poetry run pre-commit run $(PRE_COMMIT_OPTS) \
--all-files \
--color always
settings-hash: ## generate hash of settings file to apply updates to default settings
@sha512sum vscode/rootfs/root/.code-server/settings.json | cut -d " " -f 1
@echo "add the above value to PREVIOUS_DEFAULT_CONFIG_HASHES in vscode/rootfs/etc/s6-overlay/s6-rc.d/init-code-server/run"
setup: setup-poetry setup-pre-commit setup-npm ## setup dev environment
setup-npm: ## install node dependencies with npm
@npm ci
setup-poetry: ## setup python virtual environment
@poetry check
@poetry install $(POETRY_OPTS) --sync
setup-pre-commit: ## install pre-commit git hooks
@poetry run pre-commit install
spellcheck: ## run cspell
@echo "Running cSpell to checking spelling..."
@npm exec --no -- cspell lint . \
--color \
--config .vscode/cspell.json \
--dot \
--gitignore \
--must-find-files \
--no-progress \
--relative \
--show-context
test: ## run tests
@echo "no tests configured for this project"