-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
58 lines (44 loc) · 1.71 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
# Tools and Directories
LINTER = pylint
BLACK = black
FLAKE8 = flake8
AUDITER = bandit
TYPECHECKER = mypy
TARGET_DIR = cloudpwn
VENV_DIR = .venv
PYTHON_VERSION = python3.12
.DEFAULT_GOAL := help
# Targets
.PHONY: all clean setup install lint format flake8 audit typecheck help
all: clean format lint flake8 audit typecheck ## Run all quality checks
clean: ## Clean up build artifacts and Python caches
@rm -rf __pycache__ .pytest_cache
@find . -name '*.pyc' -exec rm -r {} +
@find . -name '__pycache__' -exec rm -r {} +
@rm -rf build dist
@find . -name '*.egg-info' -type d -exec rm -r {} +
setup: ## Set up the virtual environment and install dependencies
@echo "Creating virtual environment at: $(VENV_DIR)"
@$(PYTHON_VERSION) -m venv $(VENV_DIR)
@echo "Upgrading pip..."
@source $(VENV_DIR)/bin/activate && pip install --upgrade pip
@echo "Installing dependencies..."
@source $(VENV_DIR)/bin/activate && pip install -e .
@echo -e "\n✅🎉 Done.\n"
@echo "➡️ For Linux/MacOs source $(VENV_DIR)/bin/activate"
@echo "➡️ For Windows source $(VENV_DIR)/Scripts/activate"
@echo "➡️ python3 cloudpwn/main.py"
install: setup ## Install the project and dependencies
lint: ## Run pylint on the target directory
$(LINTER) $(TARGET_DIR)
format: ## Format Python files with Black and AutoPEP8
$(BLACK) .
flake8: ## Run flake8 for code style checking
$(FLAKE8) $(TARGET_DIR)
audit: ## Audit the codebase for security issues with Bandit
$(AUDITER) -r $(TARGET_DIR)
typecheck: ## Run static type checks with mypy
$(TYPECHECKER) $(TARGET_DIR)
help: ## Show this help message
@egrep -h '\s##\s' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'