-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
66 lines (51 loc) · 2.49 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
# Copyright (c) 2019-2022 Alexander Todorov <atodorov@otb.bg>
# Copyright (c) 2021 Ivajlo Karabojkov <karabojkov@kitbg.com>
#
# Licensed under GNU Affero General Public License v3 or later (AGPLv3+)
# https://www.gnu.org/licenses/agpl-3.0.html
KIWI_INCLUDE_PATH="../Kiwi/"
.PHONY: messages
messages:
if [ ! -d "$(KIWI_INCLUDE_PATH)/kiwi_lint" ]; then \
git clone --depth 1 https://github.com/kiwitcms/Kiwi.git $(KIWI_INCLUDE_PATH); \
pip install -U -r $(KIWI_INCLUDE_PATH)/requirements/base.txt; \
fi
PYTHONPATH=.:$(KIWI_INCLUDE_PATH) KIWI_TENANTS_DOMAIN='test.com' \
./manage.py makemessages --locale en --no-obsolete --no-vinaigrette --ignore "test*.py"
ls tcms_tenants/locale/*/LC_MESSAGES/*.po | xargs -n 1 -I @ msgattrib -o @ --no-fuzzy @
.PHONY: test
test:
if [ ! -d "$(KIWI_INCLUDE_PATH)/kiwi_lint" ]; then \
git clone --depth 1 https://github.com/kiwitcms/Kiwi.git $(KIWI_INCLUDE_PATH); \
pip install -U -r $(KIWI_INCLUDE_PATH)/requirements/base.txt; \
fi
PYTHONPATH=.:$(KIWI_INCLUDE_PATH) EXECUTOR=standard PYTHONWARNINGS=d AUTO_CREATE_SCHEMA='' \
KIWI_TENANTS_DOMAIN='test.com' \
coverage run --include "*/*.py" \
--omit "*/tests/*.py" \
./manage.py test -v2
PYTHONPATH=.:$(KIWI_INCLUDE_PATH) EXECUTOR=standard PYTHONWARNINGS=d AUTO_CREATE_SCHEMA='' \
KIWI_TENANTS_DOMAIN='' \
./manage.py check 2>&1 | grep "KIWI_TENANTS_DOMAIN environment variable is not set!"
.PHONY: test_for_missing_migrations
test_for_missing_migrations:
PYTHONPATH=.:$(KIWI_INCLUDE_PATH) KIWI_TENANTS_DOMAIN='test.com' ./manage.py migrate
PYTHONPATH=.:$(KIWI_INCLUDE_PATH) KIWI_TENANTS_DOMAIN='test.com' ./manage.py makemigrations --check
.PHONY: pylint
pylint:
if [ ! -d "$(KIWI_INCLUDE_PATH)/kiwi_lint" ]; then \
git clone --depth 1 https://github.com/kiwitcms/Kiwi.git $(KIWI_INCLUDE_PATH); \
pip install -U -r $(KIWI_INCLUDE_PATH)/requirements/base.txt; \
fi
PYTHONPATH=.:$(KIWI_INCLUDE_PATH) pylint \
--load-plugins=pylint.extensions.no_self_use \
--load-plugins=pylint_django --django-settings-module=test_project.settings \
--load-plugins=kiwi_lint -d similar-string \
-d missing-docstring -d duplicate-code -d module-in-directory-without-init \
--ignore migrations \
*.py tcms_settings_dir/ tcms_tenants/ tenant_groups/ test_project/
.PHONY: flake8
flake8:
flake8 *.py tcms_settings_dir/ tcms_tenants/ tenant_groups/ test_project/
.PHONY: check
check: flake8 pylint test_for_missing_migrations test