-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathrules.schema.json
More file actions
72 lines (72 loc) · 2.79 KB
/
Copy pathrules.schema.json
File metadata and controls
72 lines (72 loc) · 2.79 KB
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
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://raw.githubusercontent.com/DataDave-Dev/becwright/main/schema/rules.schema.json",
"title": "becwright rules",
"description": "Schema for .bec/rules.yaml — the rules becwright enforces on every commit. Field reference: https://github.com/DataDave-Dev/becwright/blob/main/documentation/usage.md",
"type": "object",
"additionalProperties": false,
"properties": {
"schema_version": {
"type": "integer",
"minimum": 1,
"description": "Format version of this file; absent means 1. becwright refuses a file stamped newer than it understands."
},
"rules": {
"type": "array",
"description": "The rules (BECs) enforced on every commit.",
"items": { "$ref": "#/definitions/rule" }
}
},
"definitions": {
"rule": {
"type": "object",
"additionalProperties": false,
"required": ["id", "check"],
"properties": {
"id": {
"type": "string",
"minLength": 1,
"description": "Unique rule id, e.g. no-token-in-logs."
},
"intent": {
"type": "string",
"description": "What the rule asks for — the 'bound' half of the BEC."
},
"why_it_matters": {
"type": "string",
"description": "Why the rule exists; shown the moment the rule fails."
},
"rejected_alternatives": {
"type": "array",
"items": { "type": "string" },
"description": "Context: approaches that were considered and dropped."
},
"paths": {
"type": "array",
"items": { "type": "string", "minLength": 1 },
"description": "Glob patterns of the files this rule applies to (e.g. src/**/*.py). Not needed for target: commit-msg rules."
},
"exclude": {
"type": "array",
"items": { "type": "string", "minLength": 1 },
"description": "Globs carved out of `paths` — vendored code, generated files, the check's own implementation."
},
"check": {
"type": "string",
"minLength": 1,
"description": "Shell command that runs the check: reads the file list on stdin, exits 0 (pass) or non-zero (fail). E.g. becwright run forbid --pattern '...'"
},
"severity": {
"enum": ["blocking", "warning", "advisory"],
"default": "blocking",
"description": "blocking = stops the commit | warning = deterministic finding, does not block | advisory = best-effort / non-deterministic, reports but never blocks."
},
"target": {
"enum": ["files", "commit-msg"],
"default": "files",
"description": "files = the changed files (default) | commit-msg = the commit message."
}
}
}
}
}