code-standards 7.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- code_standards-7.0.0.dist-info/METADATA +53 -0
- code_standards-7.0.0.dist-info/RECORD +99 -0
- code_standards-7.0.0.dist-info/WHEEL +4 -0
- code_standards-7.0.0.dist-info/entry_points.txt +3 -0
- code_standards-7.0.0.dist-info/licenses/LICENSE +21 -0
- sarj_standards/__init__.py +30 -0
- sarj_standards/__main__.py +5 -0
- sarj_standards/_meta.py +22 -0
- sarj_standards/api.py +890 -0
- sarj_standards/cli/__init__.py +0 -0
- sarj_standards/cli/main.py +2466 -0
- sarj_standards/configs/cli-reference.v1.json +1 -0
- sarj_standards/configs/doctor.config.json +22 -0
- sarj_standards/configs/eslint.application.mjs +1366 -0
- sarj_standards/configs/eslint.peers.json +44 -0
- sarj_standards/configs/eslint.strict.mjs +1060 -0
- sarj_standards/configs/markdownlint.strict.yaml +12 -0
- sarj_standards/configs/pyright.strict.json +96 -0
- sarj_standards/configs/ruff.application.toml +363 -0
- sarj_standards/configs/ruff.strict.toml +338 -0
- sarj_standards/configs/rule-inventory.v1.json +1 -0
- sarj_standards/configs/rule-ledger.json +846 -0
- sarj_standards/configs/rule-warning-levels.v1.json +1 -0
- sarj_standards/configs/taplo.strict.toml +14 -0
- sarj_standards/configs/yamllint.strict.yaml +25 -0
- sarj_standards/libs/__init__.py +0 -0
- sarj_standards/libs/adoption/__init__.py +0 -0
- sarj_standards/libs/adoption/configs.py +36 -0
- sarj_standards/libs/adoption/doctor.py +1346 -0
- sarj_standards/libs/adoption/exclusions.py +66 -0
- sarj_standards/libs/adoption/hooks.py +423 -0
- sarj_standards/libs/adoption/launcher.py +240 -0
- sarj_standards/libs/adoption/lifecycle.py +493 -0
- sarj_standards/libs/adoption/manifest.py +550 -0
- sarj_standards/libs/adoption/packagemanager.py +285 -0
- sarj_standards/libs/adoption/retired_suppressions.py +371 -0
- sarj_standards/libs/adoption/scaffold.py +1660 -0
- sarj_standards/libs/adoption/service.py +441 -0
- sarj_standards/libs/adoption/transaction.py +274 -0
- sarj_standards/libs/adoption/upgrade.py +516 -0
- sarj_standards/libs/adoption/uvtool.py +62 -0
- sarj_standards/libs/catalogs/__init__.py +9 -0
- sarj_standards/libs/catalogs/slack_automations.py +627 -0
- sarj_standards/libs/corpus/__init__.py +25 -0
- sarj_standards/libs/corpus/manifest.py +211 -0
- sarj_standards/libs/corpus/snapshot.py +222 -0
- sarj_standards/libs/diagnostics/__init__.py +65 -0
- sarj_standards/libs/diagnostics/analysis.schema.json +161 -0
- sarj_standards/libs/diagnostics/baseline.py +131 -0
- sarj_standards/libs/diagnostics/models.py +574 -0
- sarj_standards/libs/diagnostics/serialize.py +290 -0
- sarj_standards/libs/diagnostics/source.py +172 -0
- sarj_standards/libs/filesystem.py +11 -0
- sarj_standards/libs/linting/__init__.py +0 -0
- sarj_standards/libs/linting/analysis.py +422 -0
- sarj_standards/libs/linting/external.py +1454 -0
- sarj_standards/libs/linting/library_policy.py +688 -0
- sarj_standards/libs/linting/policy.py +152 -0
- sarj_standards/libs/linting/runner.py +442 -0
- sarj_standards/libs/linting/textlint.py +1605 -0
- sarj_standards/libs/release/__init__.py +98 -0
- sarj_standards/libs/release/_values.py +24 -0
- sarj_standards/libs/release/artifacts.py +191 -0
- sarj_standards/libs/release/causality.py +80 -0
- sarj_standards/libs/release/changes.py +48 -0
- sarj_standards/libs/release/process.py +128 -0
- sarj_standards/libs/release/publish.py +85 -0
- sarj_standards/libs/release/registry.py +271 -0
- sarj_standards/libs/release/release_age.py +218 -0
- sarj_standards/libs/release/rollout.py +1163 -0
- sarj_standards/libs/release/tags.py +373 -0
- sarj_standards/libs/release/typescript.py +191 -0
- sarj_standards/libs/repository/__init__.py +0 -0
- sarj_standards/libs/repository/cli_reference_artifact.py +324 -0
- sarj_standards/libs/repository/comment_corpus.py +536 -0
- sarj_standards/libs/repository/config_generation.py +146 -0
- sarj_standards/libs/repository/docs.py +347 -0
- sarj_standards/libs/repository/hooks.py +118 -0
- sarj_standards/libs/repository/ledger.py +99 -0
- sarj_standards/libs/repository/repository.py +744 -0
- sarj_standards/libs/repository/rule_authoring.py +246 -0
- sarj_standards/libs/repository/rule_catalog_artifact.py +479 -0
- sarj_standards/libs/repository/rule_changes.py +318 -0
- sarj_standards/libs/repository/rule_inventory_artifact.py +142 -0
- sarj_standards/libs/repository/rule_lifecycle.py +167 -0
- sarj_standards/libs/repository/rule_maintenance.py +225 -0
- sarj_standards/libs/rules/__init__.py +74 -0
- sarj_standards/libs/rules/catalog.py +145 -0
- sarj_standards/libs/rules/contracts.py +382 -0
- sarj_standards/libs/rules/corpus_runner.py +365 -0
- sarj_standards/libs/rules/evaluation.py +177 -0
- sarj_standards/libs/setup/__init__.py +4 -0
- sarj_standards/libs/setup/repository.py +40 -0
- sarj_standards/py.typed +0 -0
- sarj_standards/schemas/__init__.py +4 -0
- sarj_standards/schemas/_paths.py +7 -0
- sarj_standards/schemas/rule-catalog.v1.json +1 -0
- sarj_standards/schemas/rule-catalog.v1.schema.json +112 -0
- sarj_standards/schemas/slack-automations.v1.schema.json +1751 -0
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://code-standards.sarj.ai/api/v1/rule-catalog.schema.json",
|
|
4
|
+
"title": "Sarj Standards rule catalog",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["schemaVersion", "rules"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"schemaVersion": { "const": 1 },
|
|
10
|
+
"rules": {
|
|
11
|
+
"type": "array",
|
|
12
|
+
"items": { "$ref": "#/$defs/rule" }
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"$defs": {
|
|
16
|
+
"relativePath": {
|
|
17
|
+
"type": "string",
|
|
18
|
+
"minLength": 1,
|
|
19
|
+
"pattern": "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$)).+$"
|
|
20
|
+
},
|
|
21
|
+
"file": {
|
|
22
|
+
"type": "object",
|
|
23
|
+
"additionalProperties": false,
|
|
24
|
+
"required": ["path", "source"],
|
|
25
|
+
"properties": {
|
|
26
|
+
"path": { "$ref": "#/$defs/relativePath" },
|
|
27
|
+
"source": { "type": "string", "minLength": 1 }
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"example": {
|
|
31
|
+
"type": "object",
|
|
32
|
+
"additionalProperties": false,
|
|
33
|
+
"required": ["id", "scenarioId", "title", "outcome", "focusPath", "expectedCount", "files", "fixedFiles"],
|
|
34
|
+
"properties": {
|
|
35
|
+
"id": { "type": "string", "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$" },
|
|
36
|
+
"scenarioId": { "type": "string", "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$" },
|
|
37
|
+
"title": { "type": "string", "minLength": 1 },
|
|
38
|
+
"outcome": { "enum": ["accept", "reject"] },
|
|
39
|
+
"focusPath": { "$ref": "#/$defs/relativePath" },
|
|
40
|
+
"expectedCount": { "type": "integer", "minimum": 0 },
|
|
41
|
+
"files": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/file" } },
|
|
42
|
+
"fixedFiles": { "type": "array", "items": { "$ref": "#/$defs/file" } }
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"rule": {
|
|
46
|
+
"type": "object",
|
|
47
|
+
"additionalProperties": false,
|
|
48
|
+
"required": [
|
|
49
|
+
"key",
|
|
50
|
+
"engine",
|
|
51
|
+
"id",
|
|
52
|
+
"code",
|
|
53
|
+
"summary",
|
|
54
|
+
"rationale",
|
|
55
|
+
"remediation",
|
|
56
|
+
"category",
|
|
57
|
+
"languages",
|
|
58
|
+
"defaultLevel",
|
|
59
|
+
"autofix",
|
|
60
|
+
"status",
|
|
61
|
+
"aliases",
|
|
62
|
+
"limitations",
|
|
63
|
+
"filePatterns",
|
|
64
|
+
"messageIds",
|
|
65
|
+
"optionsSchema",
|
|
66
|
+
"references",
|
|
67
|
+
"since",
|
|
68
|
+
"source",
|
|
69
|
+
"test",
|
|
70
|
+
"examples"
|
|
71
|
+
],
|
|
72
|
+
"properties": {
|
|
73
|
+
"key": { "type": "string", "pattern": "^(eslint|iac|python|sql|text):[a-z0-9]+(?:-[a-z0-9]+)*$" },
|
|
74
|
+
"engine": { "enum": ["eslint", "iac", "python", "sql", "text"] },
|
|
75
|
+
"id": { "type": "string", "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$" },
|
|
76
|
+
"code": { "type": ["string", "null"], "minLength": 1 },
|
|
77
|
+
"summary": { "type": "string", "minLength": 1, "maxLength": 160 },
|
|
78
|
+
"rationale": { "type": "string", "minLength": 1 },
|
|
79
|
+
"remediation": { "type": "string", "minLength": 1 },
|
|
80
|
+
"category": {
|
|
81
|
+
"enum": ["architecture", "correctness", "maintainability", "performance", "security", "style", "testing"]
|
|
82
|
+
},
|
|
83
|
+
"languages": {
|
|
84
|
+
"type": "array",
|
|
85
|
+
"minItems": 1,
|
|
86
|
+
"uniqueItems": true,
|
|
87
|
+
"items": { "enum": ["config", "iac", "markdown", "python", "sql", "typescript"] }
|
|
88
|
+
},
|
|
89
|
+
"defaultLevel": { "enum": ["error", "off", "warning"] },
|
|
90
|
+
"autofix": { "enum": ["none", "safe", "suggestion"] },
|
|
91
|
+
"status": { "const": "active" },
|
|
92
|
+
"aliases": {
|
|
93
|
+
"type": "array",
|
|
94
|
+
"uniqueItems": true,
|
|
95
|
+
"items": { "type": "string", "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$" }
|
|
96
|
+
},
|
|
97
|
+
"limitations": { "type": "array", "items": { "type": "string", "minLength": 1 } },
|
|
98
|
+
"filePatterns": { "type": "array", "items": { "type": "string", "minLength": 1 } },
|
|
99
|
+
"messageIds": { "type": "array", "uniqueItems": true, "items": { "type": "string", "minLength": 1 } },
|
|
100
|
+
"optionsSchema": { "type": ["object", "null"] },
|
|
101
|
+
"references": {
|
|
102
|
+
"type": "array",
|
|
103
|
+
"items": { "type": "string", "format": "uri", "pattern": "^https://" }
|
|
104
|
+
},
|
|
105
|
+
"since": { "type": ["string", "null"] },
|
|
106
|
+
"source": { "$ref": "#/$defs/relativePath" },
|
|
107
|
+
"test": { "$ref": "#/$defs/relativePath" },
|
|
108
|
+
"examples": { "type": "array", "items": { "$ref": "#/$defs/example" } }
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|