-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathMakefile
More file actions
54 lines (40 loc) · 2.21 KB
/
Copy pathMakefile
File metadata and controls
54 lines (40 loc) · 2.21 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
52
53
54
.PHONY: test test-crops test-manures test-animals test-fertilizers
#BAKCEND TESTING
test:
docker compose exec backend python manage.py test apps.crops.tests.test_models apps.manures.tests.test_models apps.animals.tests.test_models apps.fertilizers.tests.test_models
test-crops:
docker compose exec backend python manage.py test apps.crops.tests.test_models
test-manures:
docker compose exec backend python manage.py test apps.manures.tests.test_models
test-animals:
docker compose exec backend python manage.py test apps.animals.tests.test_models
test-fertilizers:
docker compose exec backend python manage.py test apps.fertilizers.tests.test_models
#BACKEND LINTING
lint:
docker compose exec backend sh -c "cd /app && python -m flake8 && python -m pylint --recursive=y --django-settings-module=config.settings apps"
lint-flake8:
docker compose exec backend sh -c "cd /app && python -m flake8"
lint-pylint:
docker compose exec backend sh -c "cd /app && python -m pylint --recursive=y --django-settings-module=config.settings apps"
lint-check:
@echo "Checking if services are running..."
@if [ "$$(docker compose ps | grep backend | grep -c Up)" -eq 0 ]; then \
echo "Backend service is not running. Starting services..."; \
docker compose up -d; \
fi
@echo "Running linting checks..."
@docker compose exec backend sh -c "cd /app && python -m flake8" && \
docker compose exec backend sh -c "cd /app && python -m pylint --recursive=y --django-settings-module=config.settings apps"
# Run linting with detailed reports
lint-verbose:
docker compose exec backend sh -c "cd /app && python -m flake8 --statistics && python -m pylint --recursive=y --django-settings-module=config.settings --reports=y apps"
# Fix some flake8 issues automatically (with autoflake if installed)
lint-fix:
docker compose exec backend sh -c "cd /app && pip install autoflake && autoflake --in-place --remove-unused-variables --remove-all-unused-imports --recursive apps"
# Fix all flake8 issues automatically
lint-fix-all:
docker compose exec backend sh -c "cd /app && \
autoflake --in-place --remove-unused-variables --remove-all-unused-imports --recursive apps && \
autopep8 --in-place --aggressive --aggressive --recursive apps && \
isort apps"