-
Notifications
You must be signed in to change notification settings - Fork 2
/
makefile
70 lines (58 loc) · 2.57 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
58
59
60
61
62
63
64
65
66
67
68
69
70
# Set default to run all checks if none specified
.DEFAULT_GOAL := all
all: spellcheck markdownlint names codes references links check-features clean
# Check that all the specifications are named appropriately
.PHONY: names
names:
@$(MAKE) clone-sources
npx github:vegaprotocol/approbation check-filenames --specs="{./non-protocol-specs/**/*.md,./protocol/**/*.md,./protocol/**/*.ipynb}"
# Count how many Acceptance Criteria each specification has
.PHONY: codes
codes:
@$(MAKE) clone-sources
npx github:vegaprotocol/approbation check-codes --specs="{./non-protocol-specs/**/*.md,./protocol/**/*.md,./protocol/**/*.ipynb}"
TEMP=./.build
.PHONY:clone-sources
clone-sources:
@mkdir -p $(TEMP)
@echo "Cloning/updating test repos..."
@echo "==============================="
@echo ""
@cd $(TEMP); \
echo "- MultisigControl"; \
git -C MultisigControl pull || git clone https://github.com/vegaprotocol/MultisigControl.git; \
echo "- Vega"; \
git -C vega pull || git clone https://github.com/vegaprotocol/vega.git; \
echo "- Vega_token_v2"; \
git -C vega_token_v2 pull || git clone https://github.com/vegaprotocol/vega_token_v2.git; \
echo "- staking_bridge"; \
git -C staking_bridge pull || git clone https://github.com/vegaprotocol/staking_bridge.git; \
echo "- system-tests"; \
git -C system-tests pull || git clone https://github.com/vegaprotocol/system-tests.git
@echo ""
@echo "==============================="
@echo ""
# Which Acceptance Criteria are referenced in which feature files?
# Runs make clone-sources in a shell so that it properly waits for them to run in parallel and finish
.PHONY: references
references:
@$(MAKE) clone-sources
cd $(TEMP); npx -y github:vegaprotocol/approbation@latest check-references --specs="../*protocol*/*.{md,ipynb}" --tests="./**/*.{js,py,feature}" --categories="../protocol/categories.json" --show-branches --show-mystery --verbose --show-files
# Imperfect, but useful - hence not included in ALL
.PHONY: links
links:
npx --yes markdown-link-check --config .github/workflows/config/markdownlinkcheckignore.json ./*protocol*/*.md
# check the markdown formatting (/protocol specs only at this time)
.PHONY: markdownlint
markdownlint:
@./markdownlint.sh
# check the markdown spelling (/protocol specs only at this time)
.PHONY: spellcheck
spellcheck:
@./spellcheck.sh
# Checks for duplicated ACs in the features.json file
.PHONY: check-features
check-features:
npx github:vegaprotocol/approbation check-features --specs="{./non-protocol-specs/**/*.md,./protocol/**/*.md,./protocol/**/*.ipynb}" --features="./protocol/nebula-features.json"
clean:
rm -rf $(TEMP)