-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
85 lines (69 loc) · 2.05 KB
/
Makefile
File metadata and controls
85 lines (69 loc) · 2.05 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
.PHONY: all
all: ## Show the available make targets.
@echo "Usage: make <target>"
@echo ""
@echo "Targets:"
@fgrep "##" Makefile | fgrep -v fgrep
.PHONY: clean
clean: ## Clean the temporary files.
rm -rf .mypy_cache
rm -rf .ruff_cache
rm -rf .pytest_cache
rm -rf tests/__pycache__
rm -rf .coverage
rm -rf megalinter-reports/
rm -rf output
rm -rf debug.log
.PHONY: black-check
black-check: ## Run black for code formatting, without fixing.
poetry run black src --check
.PHONY: black-apply
black-apply: ## Run black and fix code formatting.
poetry run black src
.PHONY: ruff-check
ruff-check: ## Run ruff for linting and code formatting, without fixing.
poetry run ruff check src
.PHONY: ruff-apply
ruff-apply: ## Run ruff and fix linting and code formatting.
poetry run ruff check --fix src
.PHONY: pylint
pylint: ## Run pylint for code analysis.
poetry run pylint src
.PHONY: md-check
md-check: ## Run markdown linting using Markdownlint, without fixing.
@echo "Running Markdownlint...";
sh ./shell_scripts/md_lint.sh
.PHONY: md-apply
md-apply: ## Run markdown linting with Markdownlint and fix issues.
@echo "Running Markdownlint fix...";
sh ./shell_scripts/md_fix.sh
.PHONY: lint-check
lint-check: ## Run Python linters and markdown linting without fixing.
make black-check
make ruff-check
make pylint
make md-check
.PHONY: lint-apply
lint-apply: ## Run Python linters and markdown linting.
make black-apply
make ruff-apply
make pylint
make md-apply
.PHONY: megalint
megalint: ## Run the mega-linter.
docker run --platform linux/amd64 --rm \
-v /var/run/docker.sock:/var/run/docker.sock:rw \
-v $(shell pwd):/tmp/lint:rw \
oxsecurity/megalinter:v8
.PHONY: mypy
mypy: ## Run mypy.
poetry run mypy src
.PHONY: install
install: ## Install the dependencies excluding dev.
poetry install --only main --no-root
.PHONY: install-dev
install-dev: ## Install the dependencies including dev.
poetry install --no-root
.PHONY: test
test: ## Run the lambda tests.
poetry run pytest -n auto --cov=src --cov-report term-missing --cov-fail-under=95