-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
50 lines (39 loc) · 1.36 KB
/
Copy pathMakefile
File metadata and controls
50 lines (39 loc) · 1.36 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
POETRY ?= poetry
POETRY_RUN ?= $(POETRY) run
PYTHON ?= $(POETRY_RUN) python
RUFF ?= $(POETRY_RUN) ruff
PRE_COMMIT ?= $(POETRY_RUN) pre-commit
BANDIT ?= $(POETRY_RUN) bandit
PIP_AUDIT ?= $(POETRY_RUN) pip-audit
.PHONY: help install lint format format-check test compile security verify pre-commit-install
help:
@printf '%s\n' \
'NeutArr development targets:' \
' make install Install project dependencies with Poetry' \
' make lint Run Ruff lint checks' \
' make format Format Python files with Ruff' \
' make format-check Check Python formatting with Ruff' \
' make test Run unittest discovery' \
' make compile Compile Python files as a smoke check' \
' make verify Run lint, format-check, compile, and tests' \
' make security Run Bandit and pip-audit security checks' \
' make pre-commit-install Install git hooks'
install:
$(POETRY) install --no-root --with dev
lint:
$(RUFF) check .
format:
$(RUFF) format .
format-check:
$(RUFF) format --check .
test:
$(PYTHON) -m unittest discover -s tests
compile:
$(PYTHON) -m compileall -q src main.py tests
security:
$(BANDIT) -r src/ main.py -ll
$(PIP_AUDIT)
verify: lint format-check compile test
pre-commit-install:
$(PRE_COMMIT) install
$(PRE_COMMIT) install --hook-type pre-push