Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/ops/schemastore/json/progmasoft-cpp-index.json
blob: e467d4bbb57845692dd38231eb88dc8ffb5ce901 (plain)
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://schemastore.progmasoft.com/json/progmasoft-cpp-index.json",
  "title": "Progmasoft C/C++ Styles guidelines index",
  "description": "The index.json of a guidelines folder in Progmasoft C/C++ Styles (https://github.com/Progmasoft/progmasoft-cpp): the language versions it covers and every document with its chapter and the versions it applies to.",
  "type": "object",
  "required": ["title", "license", "standards", "documents"],
  "additionalProperties": false,
  "properties": {
    "$schema": {
      "description": "This schema: https://schemastore.progmasoft.com/json/progmasoft-cpp-index.json.",
      "type": "string",
      "format": "uri"
    },
    "title": {
      "description": "The name of the guidelines, such as \"Progmasoft Core C++ Coding Guidelines\".",
      "type": "string",
      "minLength": 1
    },
    "license": {
      "description": "The SPDX license identifier of the text of the guidelines.",
      "type": "string",
      "minLength": 1
    },
    "standards": {
      "description": "The language versions the guidelines cover. Exactly one is the default.",
      "type": "array",
      "minItems": 1,
      "items": { "$ref": "#/$defs/standard" },
      "contains": {
        "type": "object",
        "properties": { "default": { "const": true } },
        "required": ["default"]
      },
      "minContains": 1,
      "maxContains": 1
    },
    "documents": {
      "description": "Every document of the guidelines.",
      "type": "array",
      "minItems": 1,
      "items": { "$ref": "#/$defs/document" }
    }
  },
  "$defs": {
    "id": {
      "description": "A lowercase identifier: letters, digits and hyphens.",
      "type": "string",
      "pattern": "^[a-z][a-z0-9]*(-[a-z0-9]+)*$"
    },
    "path": {
      "description": "A Markdown file, relative to the folder of index.json, with forward slashes.",
      "type": "string",
      "pattern": "^[A-Za-z0-9_-]+(/[A-Za-z0-9_.-]+)*\\.md$"
    },
    "standard": {
      "type": "object",
      "required": ["id", "name", "default", "for", "documents"],
      "additionalProperties": false,
      "properties": {
        "id": {
          "$ref": "#/$defs/id",
          "description": "The identifier documents use in their standards list, such as \"cpp20\"."
        },
        "name": {
          "description": "The name of the version, such as \"C++20\".",
          "type": "string",
          "minLength": 1
        },
        "default": {
          "description": "Whether a project uses this version unless it says otherwise.",
          "type": "boolean"
        },
        "for": {
          "description": "The projects this version is meant for.",
          "type": "string",
          "minLength": 1
        },
        "documents": {
          "description": "The documents that hold the rules of this version alone.",
          "type": "array",
          "minItems": 1,
          "uniqueItems": true,
          "items": { "$ref": "#/$defs/path" }
        }
      }
    },
    "document": {
      "type": "object",
      "required": ["id", "title", "path", "standards"],
      "additionalProperties": false,
      "properties": {
        "id": {
          "$ref": "#/$defs/id",
          "description": "The identifier of the document, unique in the index."
        },
        "chapter": {
          "description": "The chapter number of a document shared by every version; a version's own page has none.",
          "type": "integer",
          "minimum": 1
        },
        "title": {
          "description": "The title of the document.",
          "type": "string",
          "minLength": 1
        },
        "path": { "$ref": "#/$defs/path" },
        "standards": {
          "description": "The identifiers of the versions the document applies to.",
          "type": "array",
          "minItems": 1,
          "uniqueItems": true,
          "items": { "$ref": "#/$defs/id" }
        }
      }
    }
  }
}