-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
82 lines (65 loc) · 2.83 KB
/
Copy pathMakefile
File metadata and controls
82 lines (65 loc) · 2.83 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
.PHONY: ui lint dev-setup check-no-reflection check-editors-isolation check-tree-isolation test gate
UI_PY := \
ui/mainwindow.py \
ui/json_tab_ui.py \
ui/dialogs/attach_schema_dialog.py \
ui/dialogs/qmultiline_dialog.py \
ui/dialogs/qhex_dialog.py \
ui/dialogs/secret_prefixes_dialog.py
UI_ISORT_SKIP := \
-s ui/mainwindow.py \
-s ui/json_tab_ui.py \
-s ui/dialogs/attach_schema_dialog.py \
-s ui/dialogs/qmultiline_dialog.py \
-s ui/dialogs/qhex_dialog.py \
-s ui/dialogs/secret_prefixes_dialog.py
UI_BLACK_EXCLUDE := "ui/mainwindow.py|ui/json_tab_ui\.py|ui/dialogs/(attach_schema_dialog|qmultiline_dialog|qhex_dialog|secret_prefixes_dialog)\.py"
ui: $(UI_PY)
ui/mainwindow.py: ui/mainwindow.ui
pyside6-uic $< -o $@
ui/json_tab_ui.py: ui/json_tab.ui
pyside6-uic $< -o $@
ui/dialogs/attach_schema_dialog.py: ui/dialogs/attach_schema_dialog.ui
pyside6-uic $< -o $@
ui/dialogs/qmultiline_dialog.py: ui/dialogs/qmultiline_dialog.ui
pyside6-uic $< -o $@
ui/dialogs/qhex_dialog.py: ui/dialogs/qhex_dialog.ui
pyside6-uic $< -o $@
ui/dialogs/secret_prefixes_dialog.py: ui/dialogs/secret_prefixes_dialog.ui
pyside6-uic $< -o $@
lint: ui
autoflake .
isort . \
--gitignore \
$(UI_ISORT_SKIP)
black . --line-length 120 --extend-exclude $(UI_BLACK_EXCLUDE)
# Activate the repo-local git hooks for every fresh clone.
# Idempotent — safe to run multiple times.
dev-setup:
git config core.hooksPath .githooks
@chmod +x .githooks/pre-commit .githooks/pre-commit-ci
@echo "git hooks active at .githooks/ (see plans/10-allowlist-and-precommit-hook.md)"
# Whole-tree scan: fails the build on any new getattr/hasattr outside
# the allowlist. Mirrors the staged-files check in .githooks/pre-commit.
check-no-reflection:
bash .githooks/pre-commit-ci
# Responsibility-segregation §2.5: editors/ must not import app/documents/tree
# (concrete widgets) or app/documents (the dispatch seam). Standalone target so
# it can be run in isolation; also runs inside `check-no-reflection` via the hook.
check-editors-isolation:
bash .githooks/_check_editors_isolation.sh
# Tree isolation: tree/ must not import app/documents/editors/delegates/state/validation.
# Standalone target so it can be run in isolation; also runs inside
# `check-no-reflection` via the hook.
check-tree-isolation:
bash .githooks/_check_tree_isolation.sh
# Full test suite under the offscreen Qt platform with a hard 10-minute
# wall-clock cap (see plans/20-decouple-jsontab.md Step A3 / DoD rules).
# `PYTEST_ARGS` lets callers tack on `-k pattern` or `--lf` without
# editing the recipe.
test: ui
QT_QPA_PLATFORM=offscreen timeout 600 pytest -q $(PYTEST_ARGS)
# Composite DoD gate used after every step of the decouple-jsontab plan.
# Order matches plans/20-decouple-jsontab.md §0.2: lint -> reflection ->
# full test suite. Any failure aborts the chain immediately.
gate: lint check-no-reflection test