...
1# Hacking Guide
2
3## Overview
4
5This guide contains instructions for building artifacts contained in this repository.
6
7### Go
8
9This spec includes several Go packages, and a command line tool considered to be a reference implementation of the OCI image specification.
10
11Prerequisites:
12
13- Go - current release only, earlier releases are not supported
14- make
15
16The following make targets are relevant for any work involving the Go packages.
17
18### Linting
19
20The included Go source code is being examined for any linting violations not included in the standard Go compiler.
21Linting is done using [golangci-lint][golangci-lint].
22
23Invocation:
24
25```shell
26make lint
27```
28
29### Tests
30
31This target executes all Go based tests.
32
33Invocation:
34
35```shell
36make test
37make validate-examples
38```
39
40### JSON schema formatting
41
42This target auto-formats all JSON files in the `schema` directory using the `jq` tool.
43
44Prerequisites:
45
46- [jq][jq] >=1.5
47
48Invocation:
49
50```shell
51make fmt
52```
53
54### OCI image specification PDF/HTML documentation files
55
56This target generates a PDF/HTML version of the OCI image specification.
57
58Prerequisites:
59
60- [Docker][docker]
61
62Invocation:
63
64```shell
65make docs
66```
67
68### License header check
69
70This target checks if the source code includes necessary headers.
71
72Invocation:
73
74```shell
75make check-license
76```
77
78### Clean build artifacts
79
80This target cleans all generated/compiled artifacts.
81
82Invocation:
83
84```shell
85make clean
86```
87
88### Create PNG images from dot files
89
90This target generates PNG image files from DOT source files in the `img` directory.
91
92Prerequisites:
93
94- [graphviz][graphviz]
95
96Invocation:
97
98```shell
99make img/media-types.png
100```
101
102[docker]: https://www.docker.com/
103[golangci-lint]: https://github.com/golangci/golangci-lint
104[graphviz]: https://www.graphviz.org/
105[jq]: https://stedolan.github.io/jq/
View as plain text