-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
40 lines (33 loc) · 1.27 KB
/
Makefile
File metadata and controls
40 lines (33 loc) · 1.27 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
.DEFAULT_GOAL := all
JSONSCHEMA ?= ./node_modules/@sourcemeta/jsonschema/npm/cli.js
JQ ?= jq
SHELLCHECK ?= shellcheck
MKDIRP ?= mkdir -p
NODE ?= node
NPM ?= npm
TIME ?= time
include generated.mk
# TODO: Make `jsonschema fmt` automatically detect test files
all: common test node_modules
$(NODE) $(JSONSCHEMA) fmt schemas meta
$(NODE) $(JSONSCHEMA) fmt test --default-dialect "https://json-schema.org/draft/2020-12/schema"
.PHONY: common
common: $(GENERATED) node_modules
$(TIME) $(NODE) $(JSONSCHEMA) metaschema schemas meta
$(TIME) $(NODE) $(JSONSCHEMA) lint schemas meta
$(TIME) $(NODE) $(JSONSCHEMA) validate meta/schemas-root.json schemas
$(TIME) $(NODE) $(JSONSCHEMA) validate meta/schemas.json schemas
$(TIME) $(NODE) $(JSONSCHEMA) validate meta/test.json test
$(SHELLCHECK) scripts/*.sh
./scripts/quality-schemas-tests-mirror.sh
./scripts/quality-templates-xbrl-utr-mirror.sh
# TODO: Make `jsonschema fmt` automatically detect test files
.PHONY: lint
lint: common node_modules
$(TIME) $(NODE) $(JSONSCHEMA) fmt schemas meta --check
$(TIME) $(NODE) $(JSONSCHEMA) fmt test --check --default-dialect "https://json-schema.org/draft/2020-12/schema"
.PHONY: test
test: node_modules
$(TIME) $(NODE) $(JSONSCHEMA) test ./test
node_modules: package.json package-lock.json
$(NPM) ci