Commit Graph

8 Commits

Author SHA1 Message Date
W. Trevor King 327a6367f0 Makefile: Remove unnecessary .PHONY entries
The only .PHONY entry we *need* is for schema/validate, since that's a
real file but we haven't told Make about its real dependencies (which
involve complicated Go lookups).  I'm personally in favor of using
.PHONY for all targets that aren't on-disk files, because it hints to
readers that the rule is not generating a file at the target.  But
there has been resistance to adding .PHONY entries to all such cases
(e.g. [1,2]), so this commit brings us around to a
internally-consistent "only use .PHONY when you always need it"
position.

That means that, for example, users who create files named 'clean'
will turn 'clean' the target into a no-op, but runtime-spec
maintainers are ok with that.

[1]: https://github.com/opencontainers/runtime-spec/pull/791#issuecomment-300369882
[2]: https://github.com/opencontainers/runtime-spec/pull/791#issuecomment-300612827

Signed-off-by: W. Trevor King <wking@tremily.us>
2017-05-10 16:54:53 -07:00
W. Trevor King 0b7efd2235 schema: Add 'test' target to the Makefile
And fill in some known-good and known-bad examples.  We can make this
as detailed as we want, but this commit just adds enough to know that:

* The full-file spec examples are valid.
* The JSON Schema can distinguish valid examples from invalid JSON.

This will help catch JSON Schema typos like those being addressed by
[1].

[1]: https://github.com/opencontainers/runtime-spec/pull/784

Signed-off-by: W. Trevor King <wking@tremily.us>
2017-05-09 11:10:49 -07:00
W. Trevor King 45cd926102 schema/Makefile: Add .PHONY declarations for phony targets
The only non-phony target (where the target name matches the output
file) is 'validate', but we need .PHONY there because the Go
dependencies are not represented in the Makefile.  This commit adds
the missing .PHONY declarations to the other targets, which truly are
phony.

Signed-off-by: W. Trevor King <wking@tremily.us>
2017-04-24 13:47:03 -07:00
zhouhao df784c5fb8 schema: add clean to Makefile
Signed-off-by: zhouhao <zhouhao@cn.fujitsu.com>
2017-04-18 17:51:15 +08:00
zhouhao 8b8afafec7 Makefile: modify the default value
Signed-off-by: zhouhao <zhouhao@cn.fujitsu.com>
2017-04-10 09:40:24 +08:00
zhouhao 3324e7e876 schema: add .PHONY to validate
Signed-off-by: zhouhao <zhouhao@cn.fujitsu.com>
2017-03-30 11:19:11 +08:00
Qiang Huang aaf05c4dc9 Modify README to keep consistency with Makefile
Use the name `validate` instead of `schema` for the
utility.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2016-04-14 12:33:17 +08:00
Vincent Batts cdcabdeb6b schema: JSON Schema and validator for `config.json`
Conforming to https://tools.ietf.org/html/draft-zyp-json-schema-03
and http://json-schema.org/latest/json-schema-core.html

* Utilizes a number of JSON schema features, including 'pattern'
* Defined primitives, like integers, that we'll use
* Split out definitions for primitives and platform-specific
* Provide a Makefile for:
 - "fmt" target for *.json
 - "validate" target for building the validation tool

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2016-03-09 19:32:52 +00:00