-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathMakefile
43 lines (35 loc) · 887 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
35
36
37
38
39
40
41
42
43
.phony: lint
lint:
flake8 panos_upgrade_assurance tests
.phony: security
security:
bandit -c pyproject.toml -r .
.phony: format_check
format_check:
black --diff --check panos_upgrade_assurance tests
.phony: format
format:
black panos_upgrade_assurance tests
.phony: test_coverage
test_coverage:
pytest --cov panos_upgrade_assurance --cov-report=term-missing --cov-report=xml:coverage.xml
.phony: documentation
documentation:
pydoc-markdown
.phony: check_line_length
check_line_length:
@for FILE in $$(find . -type f -name '*.py'); do \
echo $$FILE; \
LN=0; \
while read -r line; do \
LN=$$(($$LN + 1)); \
LL=$$(awk '{print length}' <<< "$$line"); \
if [ $$LL -gt 130 ]; then \
echo " line: $$LN, length: $$LL"; \
fi; \
done < "$$FILE"; \
done
.phony: all
all: lint format security test_coverage documentation
.phony: sca
sca: format lint security