-
-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathMakefile
More file actions
51 lines (41 loc) · 1.11 KB
/
Makefile
File metadata and controls
51 lines (41 loc) · 1.11 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
# Virtual environment detection
VENV = .venv
BIN = $(VENV)/bin
# If venv doesn't exist, use system binaries
ifeq (,$(wildcard $(VENV)))
PYTHON = python3
RUFF = ruff
MYPY = mypy
BANDIT = bandit
PNPM = pnpm
else
PYTHON = $(BIN)/python3
RUFF = $(BIN)/ruff
MYPY = $(BIN)/mypy
BANDIT = $(BIN)/bandit
PNPM = pnpm
endif
install:
$(PYTHON) -m pip install --upgrade pip
$(PYTHON) -m pip install -r requirements.txt
$(PYTHON) -m pip install -r requirements-dev.txt
$(PYTHON) -m pip install -e .
lint:
$(RUFF) check .
$(MYPY) src
format:
$(RUFF) check --fix .
$(RUFF) format .
security:
$(BANDIT) -r src
snyk:
@echo "Running Snyk..."
@if [ -f .env ]; then export $$(cat .env | xargs) && $(PNPM) exec snyk test --all-projects; else $(PNPM) exec snyk test --all-projects; fi
sonar:
@echo "Running SonarQube Scanner..."
@if [ -f .env ]; then export $$(cat .env | xargs) && $(PNPM) exec sonar-scanner; else $(PNPM) exec sonar-scanner; fi
test:
$(PYTHON) -m pytest tests/
coverage:
$(PYTHON) -m pytest --cov=src/pyoctaveband --cov-report=term-missing tests/
check: lint security test