Skip to content

Commit 5ef5fc9

Browse files
committed
Improve Makefile
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
1 parent dc2f2b3 commit 5ef5fc9

File tree

3 files changed

+23
-23
lines changed

3 files changed

+23
-23
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ jobs:
1919
steps:
2020
- run: sudo snap install jsonschema
2121
- uses: actions/checkout@v4
22-
- run: make ci-lint
23-
- run: make ci-test
22+
- run: make lint
23+
- run: make test

Makefile

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,23 @@ SHELLCHECK = shellcheck
33

44
# TODO: Extend `validate` to take a directory as argument
55
SCHEMAS = $(shell find schemas/ -type f -name '*.json')
6+
TESTS = $(shell find tests/ -type f -name '*.json')
67

7-
all: .always
8-
$(JSONSCHEMA) fmt conventions.json --verbose
9-
$(JSONSCHEMA) metaschema conventions.json --verbose
10-
$(JSONSCHEMA) lint conventions.json --verbose
11-
$(JSONSCHEMA) fmt --verbose
12-
$(JSONSCHEMA) fmt tests --verbose
13-
$(JSONSCHEMA) metaschema --verbose
14-
$(JSONSCHEMA) validate conventions.json --verbose $(SCHEMAS)
15-
$(JSONSCHEMA) lint --verbose
16-
$(SHELLCHECK) scripts/*.sh
17-
./scripts/schemas-tests-mirror.sh
18-
$(JSONSCHEMA) test ./tests --verbose
8+
all: common test
9+
$(JSONSCHEMA) fmt schemas tests conventions.json tests.json --verbose
1910

20-
ci-lint: .always
21-
$(JSONSCHEMA) fmt conventions.json --verbose --check
22-
$(JSONSCHEMA) metaschema conventions.json --verbose
23-
$(JSONSCHEMA) lint conventions.json --verbose
24-
$(JSONSCHEMA) fmt --verbose --check
25-
$(JSONSCHEMA) fmt tests --verbose --check
26-
$(JSONSCHEMA) metaschema --verbose
11+
common: .always
12+
$(JSONSCHEMA) metaschema schemas conventions.json tests.json --verbose
13+
$(JSONSCHEMA) lint schemas conventions.json tests.json --verbose
2714
$(JSONSCHEMA) validate conventions.json --verbose $(SCHEMAS)
28-
$(JSONSCHEMA) lint --verbose
15+
$(JSONSCHEMA) validate tests.json --verbose $(TESTS)
2916
$(SHELLCHECK) scripts/*.sh
3017
./scripts/schemas-tests-mirror.sh
3118

32-
ci-test: .always
19+
lint: common
20+
$(JSONSCHEMA) fmt schemas tests conventions.json tests.json --verbose --check
21+
22+
test: .always
3323
$(JSONSCHEMA) test ./tests --verbose
3424

3525
.always:

tests.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"type": "object",
4+
"required": [ "x-license" ],
5+
"properties": {
6+
"x-license": {
7+
"const": "https://github.com/sourcemeta/std/blob/main/LICENSE"
8+
}
9+
}
10+
}

0 commit comments

Comments
 (0)