-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
51 lines (44 loc) · 1.24 KB
/
Makefile
File metadata and controls
51 lines (44 loc) · 1.24 KB
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
# Makefile for hitlog_processing
.PHONY: format requirements lint test commit push
format:
uv run ruff format .
requirements:
uv pip compile pyproject.toml --no-reuse-hashes --output-file=requirements.txt
lint:
uv run ruff check . --exclude "*.ipynb"
test:
uv run pytest tests/
commit: format requirements lint test
@bash -c '{ \
set -e; \
git add .; \
read -p "Enter commit message: " msg; \
echo "DEBUG: Entered message: [$${msg}]"; \
if [ -z "$$(echo $${msg} | tr -d "[:space:]")" ]; then \
echo "Commit message cannot be blank or whitespace."; exit 1; \
fi; \
uv run pre-commit run --all-files || { \
echo "Pre-commit hooks failed. Files have been fixed. Please re-run make commit."; \
exit 1; \
}; \
git add .; \
git commit -m "$${msg}"; \
git push; \
}'
push: lint test
@bash -c '{ \
set -e; \
git add .; \
read -p "Enter commit message: " msg; \
echo "DEBUG: Entered message: [$${msg}]"; \
if [ -z "$$(echo $${msg} | tr -d "[:space:]")" ]; then \
echo "Commit message cannot be blank or whitespace."; exit 1; \
fi; \
uv run pre-commit run --all-files || { \
echo "Pre-commit hooks failed. Files have been fixed. Please re-run make push."; \
exit 1; \
}; \
git add .; \
git commit -m "$${msg}"; \
git push; \
}'