-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
57 lines (41 loc) · 1.51 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
SHELL=/bin/bash
DATETIME:=$(shell date -u +%Y%m%dT%H%M%SZ)
help: # Preview Makefile commands
@awk 'BEGIN { FS = ":.*#"; print "Usage: make <target>\n\nTargets:" } \
/^[-_[:alpha:]]+:.?*#/ { printf " %-15s%s\n", $$1, $$2 }' $(MAKEFILE_LIST)
#######################
# Dependency commands
#######################
install: # Install Python dependencies
pipenv install --dev
pipenv run pre-commit install
update: install # Update Python dependencies
pipenv clean
pipenv update --dev
######################
# Unit test commands
######################
test: # Run tests and print a coverage report
pipenv run coverage run --source=lambdas -m pytest -vv
pipenv run coverage report -m
coveralls: test # Write coverage data to an LCOV report
pipenv run coverage lcov -o ./coverage/lcov.info
####################################
# Code quality and safety commands
####################################
lint: black mypy ruff safety # Run linters
black: # Run 'black' linter and print a preview of suggested changes
pipenv run black --check --diff .
mypy: # Run 'mypy' linter
pipenv run mypy .
ruff: # Run 'ruff' linter and print a preview of errors
pipenv run ruff check .
safety: # Check for security vulnerabilities and verify Pipfile.lock is up-to-date
pipenv check
pipenv verify
lint-apply: # Apply changes with 'black' and resolve 'fixable errors' with 'ruff'
black-apply ruff-apply
black-apply: # Apply changes with 'black'
pipenv run black .
ruff-apply: # Resolve 'fixable errors' with 'ruff'
pipenv run ruff check --fix .