-
Notifications
You must be signed in to change notification settings - Fork 86
/
Makefile
41 lines (30 loc) · 1.04 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
.PHONY: lint
lint: check-mypy-error-count
poetry run flake8 baal experiments
.PHONY: test
test: lint
poetry run pytest tests --cov=baal
.PHONY: format
format:
poetry run black baal experiments
.PHONY: requirements.txt
requirements.txt: poetry.lock
poetry export --without-hashes -f requirements.txt > requirements.txt
.PHONY: mypy
mypy:
poetry run mypy --show-error-codes baal
.PHONY: check-mypy-error-count
check-mypy-error-count: MYPY_INFO = $(shell expr `poetry run mypy baal | grep ": error" | wc -l`)
check-mypy-error-count: MYPY_ERROR_COUNT = 6
check-mypy-error-count:
@if [ ${MYPY_INFO} -gt ${MYPY_ERROR_COUNT} ]; then \
echo mypy error count $(MYPY_INFO) is more than $(MYPY_ERROR_COUNT); \
false; \
fi
SRC_FOLDER ?= ./baal
REPORT_FOLDER ?= ./reports
./reports/security/bandit/:
@mkdir -p ./reports/security/bandit/
bandit: ./reports/security/bandit/ ## SECURITY - Run bandit
poetry run bandit ${SRC_FOLDER}/* -r -x "*.pyi,*/_generated/*,*__pycache__*" -v -ll -f json > ${REPORT_FOLDER}/security/bandit/index.json
.PHONY: bandit