Skip to content

Commit

Permalink
Merge pull request #252 from ma10/refine-checks-202405
Browse files Browse the repository at this point in the history
プロダクト対象のチェックの記述方法の見直しと、チェックシート精製用JSONスクリプトの追加
  • Loading branch information
ma10 authored Jul 16, 2024
2 parents c3df7f8 + c7e0c67 commit ad606fe
Show file tree
Hide file tree
Showing 185 changed files with 1,634 additions and 1,025 deletions.
2 changes: 1 addition & 1 deletion build.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
rootdir = $(ROOTDIR)
PYTHON?= python
YAML2RST= $(PYTHON) $(rootdir)/tools/yaml2rst/yaml2rst.py -b $(rootdir) -l $(lang)
YAML2RST= $(PYTHON) $(rootdir)/tools/yaml2x/yaml2rst/yaml2rst.py -b $(rootdir) -l $(lang)

ifneq ($(BASE_URL),)
html_baseurl = $(BASE_URL)
Expand Down
214 changes: 168 additions & 46 deletions data/json/schemas/check.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@
"type": "string",
"pattern": "^[0-9]{4}"
},
"sortKey": {
"description": "a sort key for the check",
"type": "integer"
},
"check": {
"description": "main text of the check",
"$ref": "common.json#/definitions/i18nString"
"$ref": "common.json#/$defs/i18nString"
},
"severity": {
"description": "severity of the issue if the check fails",
Expand Down Expand Up @@ -42,62 +46,96 @@
]
}
},
"procedures": {
"description": "suggested procedures for performing the check",
"conditions": {
"description": "conditions for performing the check",
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"properties": {
"platform": {
"type": "string",
"enum": ["web", "mobile", "general"]
"enum": ["web", "mobile", "ios", "android", "general"]
},
"type": {
"type": "string",
"enum": ["simple", "and", "or"]
},
"id": {
"description": "a unique identifier for the technique, prefixed by the check ID (only for simple type)",
"type": "string",
"pattern": "^[0-9]{4}-.+"
},
"tool": {
"type": "string",
"description": "name of the tool (only for simple type)"
},
"procedure": {
"$ref": "common.json#/definitions/i18nString"
"$ref": "common.json#/$defs/i18nString",
"description": "procedure text (only for simple type)"
},
"techniques": {
"description": "one or more specific techniques for performing the check",
"note": {
"description": "additional info about the technique, which will be omitted from the checklist (the spreadsheet, only for simple type)",
"$ref": "common.json#/$defs/i18nString"
},
"YouTube": {
"type": "object",
"properties": {
"id": {
"description": "YouTube video ID (only for simple type)",
"type": "string"
},
"title": {
"description": "title of the video (only for simple type)",
"type": "string"
}
},
"required": ["id", "title"],
"additionalProperties": false
},
"conditions": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"$ref": "#/$defs/conditionBase"
},
"description": "nested conditions (only for and/or types)"
}
},
"required": ["platform", "type"],
"additionalProperties": false,
"allOf": [
{
"if": {
"properties": {
"tool": {
"description": "name of a tool to be used for performing the check",
"type": "string"
},
"technique": {
"description": "specific procedure for performing the check with the tool",
"$ref": "common.json#/definitions/i18nString"
},
"note": {
"description": "additional info about the technique, which will be omitted from the checklist (the spreadsheet)",
"$ref": "common.json#/definitions/i18nString"
},
"YouTube": {
"type": "object",
"properties": {
"id": {
"description": "YouTube video ID",
"type": "string"
},
"title": {
"description": "title of the video",
"type": "string"
}
},
"required": ["id", "title"],
"additionalProperties": false
}
},
"additionalProperties": false,
"required": ["tool", "technique"]
"type": { "const": "simple" }
}
},
"then": {
"required": ["id", "tool", "procedure"],
"properties": {
"conditions": { "not": {} }
}
}
},
{
"if": {
"properties": {
"type": { "enum": ["and", "or"] }
}
},
"then": {
"required": ["conditions"],
"properties": {
"id": { "not": {} },
"tool": { "not": {} },
"procedure": { "not": {} },
"note": { "not": {} },
"YouTube": { "not": {} }
}
}
}
},
"required": ["platform", "procedure"],
"additionalProperties": false
]
}
},
"implementations": {
Expand All @@ -109,7 +147,7 @@
"properties": {
"title": {
"description": "purpose of the implementation",
"$ref": "common.json#/definitions/i18nString"
"$ref": "common.json#/$defs/i18nString"
},
"methods": {
"description": "one or more methods of the implementation, set of target platform and the specific implementation method",
Expand All @@ -124,7 +162,7 @@
},
"method": {
"description": "an example of how to implement",
"$ref": "common.json#/definitions/i18nString"
"$ref": "common.json#/$defs/i18nString"
}
},
"additionalProperties": false,
Expand All @@ -137,23 +175,107 @@
}
}
},
"$defs": {
"conditionBase": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": ["simple", "and", "or"]
},
"id": {
"description": "a unique identifier for the technique, prefixed by the check ID (only for simple type)",
"type": "string",
"pattern": "^[0-9]{4}-.+"
},
"tool": {
"type": "string",
"description": "name of the tool (only for simple type)"
},
"procedure": {
"$ref": "common.json#/$defs/i18nString",
"description": "procedure text (only for simple type)"
},
"note": {
"description": "additional info about the technique, which will be omitted from the checklist (the spreadsheet, only for simple type)",
"$ref": "common.json#/$defs/i18nString"
},
"YouTube": {
"type": "object",
"properties": {
"id": {
"description": "YouTube video ID (only for simple type)",
"type": "string"
},
"title": {
"description": "title of the video (only for simple type)",
"type": "string"
}
},
"required": ["id", "title"],
"additionalProperties": false
},
"conditions": {
"type": "array",
"minItems": 1,
"items": {
"$ref": "#/$defs/conditionBase"
},
"description": "nested conditions (only for and/or types)"
}
},
"required": ["type"],
"allOf": [
{
"if": {
"properties": {
"type": { "const": "simple" }
}
},
"then": {
"required": ["id", "tool", "procedure"],
"properties": {
"conditions": { "not": {} }
}
}
},
{
"if": {
"properties": {
"type": { "enum": ["and", "or"] }
}
},
"then": {
"required": ["conditions"],
"properties": {
"id": { "not": {} },
"tool": { "not": {} },
"procedure": { "not": {} },
"note": { "not": {} },
"YouTube": { "not": {} }
}
}
}
]
}
},
"allOf": [
{
"if": {
"properties": {
"target": {"const": "product"}
"target": { "const": "product" }
}
},
"else": {
"not": {
"required": ["procedures"]
"required": ["conditions"]
}
}
},
{
"if": {
"properties": {
"target": {"const": "code"}
"target": { "const": "code" }
}
},
"else": {
Expand Down
2 changes: 1 addition & 1 deletion data/json/schemas/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$id": "https://a11y-guidelines.freee.co.jp/schemas/common.json",
"type": "object",

"definitions": {
"$defs": {
"i18nString": {
"type": "object",
"properties": {
Expand Down
8 changes: 4 additions & 4 deletions data/json/schemas/faq.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,19 @@
},
"title": {
"description": "title of the FAQ",
"$ref": "common.json#/definitions/i18nString"
"$ref": "common.json#/$defs/i18nString"
},
"problem": {
"description": "the problem or the question",
"$ref": "common.json#/definitions/i18nString"
"$ref": "common.json#/$defs/i18nString"
},
"solution": {
"description": "the solution or the answer",
"$ref": "common.json#/definitions/i18nString"
"$ref": "common.json#/$defs/i18nString"
},
"explanation": {
"description": "detailed explanation",
"$ref": "common.json#/definitions/i18nString"
"$ref": "common.json#/$defs/i18nString"
},
"guidelines": {
"description": "related guidelines, if any",
Expand Down
6 changes: 3 additions & 3 deletions data/json/schemas/guideline.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"title": {
"description": "title of the guideline",
"$ref": "common.json#/definitions/i18nString"
"$ref": "common.json#/$defs/i18nString"
},
"category": {
"description": "category the guideline belongs to",
Expand Down Expand Up @@ -50,7 +50,7 @@
},
"guideline": {
"description": "main text of the guideline",
"$ref": "common.json#/definitions/i18nString"
"$ref": "common.json#/$defs/i18nString"
},
"sc": {
"description": "WCAG SC the guideline corresponds to",
Expand All @@ -63,7 +63,7 @@
},
"intent": {
"description": "who benefits and how from the guideline",
"$ref": "common.json#/definitions/i18nString"
"$ref": "common.json#/$defs/i18nString"
},
"checks": {
"description": "IDs of the checks for conformance to the guideline",
Expand Down
1 change: 1 addition & 0 deletions data/yaml/checks/code/0071.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
id: '0071'
sortKey: 200000
severity: normal
target: code
platform:
Expand Down
1 change: 1 addition & 0 deletions data/yaml/checks/code/0311.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
id: '0311'
sortKey: 200100
severity: normal
target: code
platform:
Expand Down
1 change: 1 addition & 0 deletions data/yaml/checks/code/0371.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
id: '0371'
sortKey: 200200
severity: major
target: code
platform:
Expand Down
1 change: 1 addition & 0 deletions data/yaml/checks/code/0401.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
id: '0401'
sortKey: 200300
severity: major
target: code
platform:
Expand Down
1 change: 1 addition & 0 deletions data/yaml/checks/code/0402.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
id: '0402'
sortKey: 200400
severity: normal
target: code
platform:
Expand Down
1 change: 1 addition & 0 deletions data/yaml/checks/code/0431.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
id: '0431'
sortKey: 200500
severity: major
target: code
platform:
Expand Down
1 change: 1 addition & 0 deletions data/yaml/checks/code/0461.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
id: '0461'
sortKey: 200600
severity: normal
target: code
platform:
Expand Down
1 change: 1 addition & 0 deletions data/yaml/checks/code/0521.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
id: '0521'
sortKey: 200700
severity: major
target: code
platform:
Expand Down
Loading

0 comments on commit ad606fe

Please sign in to comment.