-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
63 lines (51 loc) · 1.57 KB
/
Copy pathMakefile
File metadata and controls
63 lines (51 loc) · 1.57 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
.DEFAULT_GOAL := all
.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 .pytest_cache
rm -rf .mypy_cache
rm -rf .coverage
rm -rf .ruff_cache
rm -rf megalinter-reports
.PHONY: format
format: ## Format the code.
poetry run ruff check . --fix
poetry run ruff format .
.PHONY: lint
lint: ## Run all linters (ruff/pylint/mypy).
poetry run ruff check .
poetry run ruff format --check .
make mypy
.PHONY: pre-commit
pre-commit: ## Run all pre-commit hooks across the repository.
poetry run pre-commit run --all-files
.PHONY: install-pre-commit
install-pre-commit: ## Install the local git pre-commit hooks.
poetry run pre-commit install
.PHONY: test
test: ## Run the tests and check coverage.
poetry run pytest -n auto --cov=dis_python_logger --cov-report term-missing --cov-fail-under=100
.PHONY: mypy
mypy: ## Run mypy.
poetry run mypy dis_python_logger
.PHONY: run
run: ## Run the python script
poetry run python -m dis_python_logger
.PHONY: install
install: ## Install the dependencies excluding dev.
poetry install --only main
.PHONY: install-dev
install-dev: ## Install the dependencies including dev.
poetry install
.PHONY: megalint
megalint: ## Run the mega-linter. Use LINTER=NAME to run only one.
docker run --platform linux/amd64 --rm \
-v /var/run/docker.sock:/var/run/docker.sock:rw \
-v $(shell pwd):/tmp/lint:rw \
$(if $(LINTER),-e ENABLE_LINTERS=$(LINTER),) \
ghcr.io/oxsecurity/megalinter:v9