SpecSheriffIn progress
rule · _guidelines/tools/7.1.2 · s-xzcw3hv4hmxz7h7

The schema and a project's extension

Checkedconfirmed by its owner

sheriff validate validates each file with a JSON Schema validator against the base schema of the SpecSheriff guidelines, composed with the project's extension (§s-eferktypcj7njt5).

The extension is validated first, against the schema of an extension. That schema lets an extension add only kinds, fields of an existing kind, and properties of a file or of a link.

What the extension adds joins the base schema:

  • its kinds join the kinds a node may have;
  • its conditions join those every node is held to;
  • its properties of a file and of a link join those a file and a link may hold.

sheriff binding validates each file against the same schema before it checks anything.

sheriff reindex validates each file once it has merged each key written twice and changed what an earlier release wrote, as §s-f5rz6b7dhxejjts says, and before it computes anything. It leaves out of that validation only what it writes itself:

  • the links pointing at a node;
  • outside the archive, a sid a node lacks, every location, a header's index of its sections and the values gathered beside a field.

Where the schema refuses a file, or the schema of an extension refuses the project's extension, each of the two commands names that file or the extension and every refusal in it. It then checks nothing more, and sheriff reindex writes no file.

Why

Each command is written for the shape the schema gives a file. Only a validation against the schema names where a file departs from that shape and what is wrong there. sheriff reindex builds each file from all of them, so writing only some would leave the files disagreeing with one another. A key written twice is merged first, since a file read without the merge holds only its last value. What an earlier release wrote is changed first, since the schema refuses its old names. What sheriff reindex writes itself is left out, since a node written by hand lacks it until the command runs.

The links it makes

The links made to it

The tests bound to it