-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
34 lines (30 loc) · 947 Bytes
/
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
.PHONY: create-venv install-deps lint format
# Create virtual environment only if .venv doesn't exist
create-venv:
@if [ ! -d ".venv" ]; then \
if ! python3 -m venv --help >/dev/null 2>&1; then \
echo "Python venv module not available. Please install Python with venv support."; \
exit 1; \
fi; \
python3 -m venv .venv; \
fi
install-deps:
@if command -v pip >/dev/null 2>&1; then \
pip install yamllint yamlfix pre-commit; \
pre-commit install; \
else \
echo "Pip not found or not running with venv. Please run \`make create-venv\` first."; \
exit 1; \
fi
lint:
@if [ -z "$$VIRTUAL_ENV" ]; then \
echo "Please activate Python virtual environment first."; \
exit 1; \
fi; \
yamllint .
format:
@if [ -z "$$VIRTUAL_ENV" ]; then \
echo "Please activate Python virtual environment first."; \
exit 1; \
fi; \
yamlfix . --config-file .yamlfix.toml --exclude ".github/**" --exclude ".venv/**" --exclude "venv/**"