@oddessentials/repo-standards 5.0.0 → 5.2.0
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.
- package/README.md +7 -1
- package/dist/config/standards.csharp-dotnet.azure-devops.json +52 -1
- package/dist/config/standards.csharp-dotnet.github-actions.json +52 -1
- package/dist/config/standards.csharp-dotnet.json +60 -1
- package/dist/config/standards.go.azure-devops.json +50 -1
- package/dist/config/standards.go.github-actions.json +50 -1
- package/dist/config/standards.go.json +58 -1
- package/dist/config/standards.json +210 -1
- package/dist/config/standards.python.azure-devops.json +56 -1
- package/dist/config/standards.python.github-actions.json +56 -1
- package/dist/config/standards.python.json +64 -1
- package/dist/config/standards.rust.azure-devops.json +51 -1
- package/dist/config/standards.rust.github-actions.json +51 -1
- package/dist/config/standards.rust.json +59 -1
- package/dist/config/standards.typescript-js.azure-devops.json +57 -1
- package/dist/config/standards.typescript-js.github-actions.json +57 -1
- package/dist/config/standards.typescript-js.json +65 -1
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/scripts/check-version-unchanged.sh +50 -0
- package/scripts/sync-standards-version.cjs +72 -0
- package/scripts/validate-schema.ts +47 -1
package/README.md
CHANGED
|
@@ -68,7 +68,7 @@ The master spec includes a `meta` block that defines system-wide expectations:
|
|
|
68
68
|
|
|
69
69
|
## Structure of `config/standards.json`
|
|
70
70
|
|
|
71
|
-
- `version` — schema version (currently `
|
|
71
|
+
- `version` — schema version (currently `5`)
|
|
72
72
|
- `meta` — global rules and migration policy
|
|
73
73
|
- `ciSystems` — supported CI platforms
|
|
74
74
|
_(currently `github-actions`, `azure-devops`)_
|
|
@@ -104,6 +104,12 @@ The `version` field indicates schema compatibility:
|
|
|
104
104
|
- `2` — Adds `bazelHints`, `meta.executorHints.bazel` for Bazel support, `anyOfFiles`, `pinningNotes`, enforcement/severity levels, ratio-based coverage thresholds, Rust/Go stacks. Enforces strict validation with `additionalProperties: false`.
|
|
105
105
|
- `3` — Expands release, build determinism, and provenance/CI automation requirements; adds unified release workflow and template automation guidance.
|
|
106
106
|
- `4` — Stable API contract with `getStandards()`, `getSchema()`, `STANDARDS_VERSION` exports; Node 22 LTS alignment.
|
|
107
|
+
- `5` — Adds automated version-guard guidance for repositories using semantic-release; schema aligned to package major version 5.
|
|
108
|
+
|
|
109
|
+
To keep `config/standards.json` in sync with semantic-release major bumps, use
|
|
110
|
+
`scripts/sync-standards-version.cjs` during the semantic-release prepare step
|
|
111
|
+
and commit the updated files. This updates the schema version and README
|
|
112
|
+
references in one place.
|
|
107
113
|
|
|
108
114
|
Consumers should ignore unknown fields for forward compatibility.
|
|
109
115
|
|
|
@@ -206,6 +206,57 @@
|
|
|
206
206
|
"verification": "Check that versioning is driven by a SemVer-aware tool (for example, GitVersion) and verify that running the release/versioning step locally or in CI produces the expected version metadata, updates project files, and generates changelog entries from commit history."
|
|
207
207
|
}
|
|
208
208
|
},
|
|
209
|
+
{
|
|
210
|
+
"ciHints": {
|
|
211
|
+
"azure-devops": {
|
|
212
|
+
"notes": "Run the version guard in PR validation jobs before merge.",
|
|
213
|
+
"stage": "quality"
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
"description": "If semantic-release or automated versioning is enabled, block manual edits to canonical version fields in pull requests. Enforce a CI guard (and optional pre-push hook) that fails when version lines change outside the release workflow.",
|
|
217
|
+
"id": "version-guard",
|
|
218
|
+
"label": "Version Guard (Automated Releases)",
|
|
219
|
+
"stack": {
|
|
220
|
+
"exampleConfigFiles": [
|
|
221
|
+
"scripts/check-version-unchanged.sh",
|
|
222
|
+
".github/workflows/ci.yml",
|
|
223
|
+
"azure-pipelines.yml"
|
|
224
|
+
],
|
|
225
|
+
"exampleTools": [
|
|
226
|
+
"GitVersion",
|
|
227
|
+
"git"
|
|
228
|
+
],
|
|
229
|
+
"notes": "When GitVersion or similar tooling computes versions, block manual edits to Directory.Build.props or *.csproj version fields via the version guard. Allow changes only in release automation.",
|
|
230
|
+
"optionalFiles": [
|
|
231
|
+
"Directory.Build.props",
|
|
232
|
+
"*.csproj",
|
|
233
|
+
"VERSION"
|
|
234
|
+
],
|
|
235
|
+
"verification": "Run the guard and confirm it fails when <Version> or <VersionPrefix> changes in props/csproj files."
|
|
236
|
+
}
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
"ciHints": {
|
|
240
|
+
"azure-devops": {
|
|
241
|
+
"notes": "Ensure format:check step uses ignore file that excludes release artifacts.",
|
|
242
|
+
"stage": "quality"
|
|
243
|
+
}
|
|
244
|
+
},
|
|
245
|
+
"description": "Exclude auto-generated release artifacts (CHANGELOG.md, package-lock.json, etc.) from code formatters to prevent CI failures. Release automation tools generate files that may not conform to your formatter's style, causing format checks to fail on subsequent CI runs.",
|
|
246
|
+
"id": "release-artifact-exclusion",
|
|
247
|
+
"label": "Release Artifact Formatter Exclusion",
|
|
248
|
+
"stack": {
|
|
249
|
+
"exampleConfigFiles": [
|
|
250
|
+
".editorconfig"
|
|
251
|
+
],
|
|
252
|
+
"exampleTools": [
|
|
253
|
+
"dotnet format",
|
|
254
|
+
"GitVersion"
|
|
255
|
+
],
|
|
256
|
+
"notes": "Use .editorconfig to exclude auto-generated files from formatting. GitVersion may generate or modify files that shouldn't be reformatted. Add glob patterns for generated code directories (e.g., **/obj/**, **/bin/**).",
|
|
257
|
+
"verification": "Run 'dotnet format --verify-no-changes' and confirm generated files are excluded."
|
|
258
|
+
}
|
|
259
|
+
},
|
|
209
260
|
{
|
|
210
261
|
"ciHints": {
|
|
211
262
|
"azure-devops": {
|
|
@@ -1199,5 +1250,5 @@
|
|
|
1199
1250
|
},
|
|
1200
1251
|
"stack": "csharp-dotnet",
|
|
1201
1252
|
"stackLabel": "C# / .NET",
|
|
1202
|
-
"version":
|
|
1253
|
+
"version": 5
|
|
1203
1254
|
}
|
|
@@ -206,6 +206,57 @@
|
|
|
206
206
|
"verification": "Check that versioning is driven by a SemVer-aware tool (for example, GitVersion) and verify that running the release/versioning step locally or in CI produces the expected version metadata, updates project files, and generates changelog entries from commit history."
|
|
207
207
|
}
|
|
208
208
|
},
|
|
209
|
+
{
|
|
210
|
+
"ciHints": {
|
|
211
|
+
"github-actions": {
|
|
212
|
+
"job": "ci",
|
|
213
|
+
"notes": "Run the version guard in PR workflows against the base ref."
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
"description": "If semantic-release or automated versioning is enabled, block manual edits to canonical version fields in pull requests. Enforce a CI guard (and optional pre-push hook) that fails when version lines change outside the release workflow.",
|
|
217
|
+
"id": "version-guard",
|
|
218
|
+
"label": "Version Guard (Automated Releases)",
|
|
219
|
+
"stack": {
|
|
220
|
+
"exampleConfigFiles": [
|
|
221
|
+
"scripts/check-version-unchanged.sh",
|
|
222
|
+
".github/workflows/ci.yml",
|
|
223
|
+
"azure-pipelines.yml"
|
|
224
|
+
],
|
|
225
|
+
"exampleTools": [
|
|
226
|
+
"GitVersion",
|
|
227
|
+
"git"
|
|
228
|
+
],
|
|
229
|
+
"notes": "When GitVersion or similar tooling computes versions, block manual edits to Directory.Build.props or *.csproj version fields via the version guard. Allow changes only in release automation.",
|
|
230
|
+
"optionalFiles": [
|
|
231
|
+
"Directory.Build.props",
|
|
232
|
+
"*.csproj",
|
|
233
|
+
"VERSION"
|
|
234
|
+
],
|
|
235
|
+
"verification": "Run the guard and confirm it fails when <Version> or <VersionPrefix> changes in props/csproj files."
|
|
236
|
+
}
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
"ciHints": {
|
|
240
|
+
"github-actions": {
|
|
241
|
+
"job": "ci",
|
|
242
|
+
"notes": "Ensure format:check step uses ignore file that excludes release artifacts."
|
|
243
|
+
}
|
|
244
|
+
},
|
|
245
|
+
"description": "Exclude auto-generated release artifacts (CHANGELOG.md, package-lock.json, etc.) from code formatters to prevent CI failures. Release automation tools generate files that may not conform to your formatter's style, causing format checks to fail on subsequent CI runs.",
|
|
246
|
+
"id": "release-artifact-exclusion",
|
|
247
|
+
"label": "Release Artifact Formatter Exclusion",
|
|
248
|
+
"stack": {
|
|
249
|
+
"exampleConfigFiles": [
|
|
250
|
+
".editorconfig"
|
|
251
|
+
],
|
|
252
|
+
"exampleTools": [
|
|
253
|
+
"dotnet format",
|
|
254
|
+
"GitVersion"
|
|
255
|
+
],
|
|
256
|
+
"notes": "Use .editorconfig to exclude auto-generated files from formatting. GitVersion may generate or modify files that shouldn't be reformatted. Add glob patterns for generated code directories (e.g., **/obj/**, **/bin/**).",
|
|
257
|
+
"verification": "Run 'dotnet format --verify-no-changes' and confirm generated files are excluded."
|
|
258
|
+
}
|
|
259
|
+
},
|
|
209
260
|
{
|
|
210
261
|
"ciHints": {
|
|
211
262
|
"github-actions": {
|
|
@@ -1199,5 +1250,5 @@
|
|
|
1199
1250
|
},
|
|
1200
1251
|
"stack": "csharp-dotnet",
|
|
1201
1252
|
"stackLabel": "C# / .NET",
|
|
1202
|
-
"version":
|
|
1253
|
+
"version": 5
|
|
1203
1254
|
}
|
|
@@ -229,6 +229,65 @@
|
|
|
229
229
|
"verification": "Check that versioning is driven by a SemVer-aware tool (for example, GitVersion) and verify that running the release/versioning step locally or in CI produces the expected version metadata, updates project files, and generates changelog entries from commit history."
|
|
230
230
|
}
|
|
231
231
|
},
|
|
232
|
+
{
|
|
233
|
+
"ciHints": {
|
|
234
|
+
"azure-devops": {
|
|
235
|
+
"notes": "Run the version guard in PR validation jobs before merge.",
|
|
236
|
+
"stage": "quality"
|
|
237
|
+
},
|
|
238
|
+
"github-actions": {
|
|
239
|
+
"job": "ci",
|
|
240
|
+
"notes": "Run the version guard in PR workflows against the base ref."
|
|
241
|
+
}
|
|
242
|
+
},
|
|
243
|
+
"description": "If semantic-release or automated versioning is enabled, block manual edits to canonical version fields in pull requests. Enforce a CI guard (and optional pre-push hook) that fails when version lines change outside the release workflow.",
|
|
244
|
+
"id": "version-guard",
|
|
245
|
+
"label": "Version Guard (Automated Releases)",
|
|
246
|
+
"stack": {
|
|
247
|
+
"exampleConfigFiles": [
|
|
248
|
+
"scripts/check-version-unchanged.sh",
|
|
249
|
+
".github/workflows/ci.yml",
|
|
250
|
+
"azure-pipelines.yml"
|
|
251
|
+
],
|
|
252
|
+
"exampleTools": [
|
|
253
|
+
"GitVersion",
|
|
254
|
+
"git"
|
|
255
|
+
],
|
|
256
|
+
"notes": "When GitVersion or similar tooling computes versions, block manual edits to Directory.Build.props or *.csproj version fields via the version guard. Allow changes only in release automation.",
|
|
257
|
+
"optionalFiles": [
|
|
258
|
+
"Directory.Build.props",
|
|
259
|
+
"*.csproj",
|
|
260
|
+
"VERSION"
|
|
261
|
+
],
|
|
262
|
+
"verification": "Run the guard and confirm it fails when <Version> or <VersionPrefix> changes in props/csproj files."
|
|
263
|
+
}
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
"ciHints": {
|
|
267
|
+
"azure-devops": {
|
|
268
|
+
"notes": "Ensure format:check step uses ignore file that excludes release artifacts.",
|
|
269
|
+
"stage": "quality"
|
|
270
|
+
},
|
|
271
|
+
"github-actions": {
|
|
272
|
+
"job": "ci",
|
|
273
|
+
"notes": "Ensure format:check step uses ignore file that excludes release artifacts."
|
|
274
|
+
}
|
|
275
|
+
},
|
|
276
|
+
"description": "Exclude auto-generated release artifacts (CHANGELOG.md, package-lock.json, etc.) from code formatters to prevent CI failures. Release automation tools generate files that may not conform to your formatter's style, causing format checks to fail on subsequent CI runs.",
|
|
277
|
+
"id": "release-artifact-exclusion",
|
|
278
|
+
"label": "Release Artifact Formatter Exclusion",
|
|
279
|
+
"stack": {
|
|
280
|
+
"exampleConfigFiles": [
|
|
281
|
+
".editorconfig"
|
|
282
|
+
],
|
|
283
|
+
"exampleTools": [
|
|
284
|
+
"dotnet format",
|
|
285
|
+
"GitVersion"
|
|
286
|
+
],
|
|
287
|
+
"notes": "Use .editorconfig to exclude auto-generated files from formatting. GitVersion may generate or modify files that shouldn't be reformatted. Add glob patterns for generated code directories (e.g., **/obj/**, **/bin/**).",
|
|
288
|
+
"verification": "Run 'dotnet format --verify-no-changes' and confirm generated files are excluded."
|
|
289
|
+
}
|
|
290
|
+
},
|
|
232
291
|
{
|
|
233
292
|
"ciHints": {
|
|
234
293
|
"azure-devops": {
|
|
@@ -1343,5 +1402,5 @@
|
|
|
1343
1402
|
},
|
|
1344
1403
|
"stack": "csharp-dotnet",
|
|
1345
1404
|
"stackLabel": "C# / .NET",
|
|
1346
|
-
"version":
|
|
1405
|
+
"version": 5
|
|
1347
1406
|
}
|
|
@@ -202,6 +202,55 @@
|
|
|
202
202
|
"verification": "Check that git tags follow vMAJOR.MINOR.PATCH format and goreleaser or similar tooling generates releases and changelogs."
|
|
203
203
|
}
|
|
204
204
|
},
|
|
205
|
+
{
|
|
206
|
+
"ciHints": {
|
|
207
|
+
"azure-devops": {
|
|
208
|
+
"notes": "Run the version guard in PR validation jobs before merge.",
|
|
209
|
+
"stage": "quality"
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
"description": "If semantic-release or automated versioning is enabled, block manual edits to canonical version fields in pull requests. Enforce a CI guard (and optional pre-push hook) that fails when version lines change outside the release workflow.",
|
|
213
|
+
"id": "version-guard",
|
|
214
|
+
"label": "Version Guard (Automated Releases)",
|
|
215
|
+
"stack": {
|
|
216
|
+
"exampleConfigFiles": [
|
|
217
|
+
"scripts/check-version-unchanged.sh",
|
|
218
|
+
".github/workflows/ci.yml",
|
|
219
|
+
"azure-pipelines.yml"
|
|
220
|
+
],
|
|
221
|
+
"exampleTools": [
|
|
222
|
+
"goreleaser",
|
|
223
|
+
"git"
|
|
224
|
+
],
|
|
225
|
+
"notes": "Go versioning is tag-driven; only enable the guard if you keep a VERSION file or embed version constants in code. The guard should ensure those fields are not edited manually in PRs.",
|
|
226
|
+
"optionalFiles": [
|
|
227
|
+
"VERSION"
|
|
228
|
+
],
|
|
229
|
+
"verification": "Run the guard and confirm it fails when VERSION or version constants change outside release automation."
|
|
230
|
+
}
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
"ciHints": {
|
|
234
|
+
"azure-devops": {
|
|
235
|
+
"notes": "Ensure format:check step uses ignore file that excludes release artifacts.",
|
|
236
|
+
"stage": "quality"
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
"description": "Exclude auto-generated release artifacts (CHANGELOG.md, package-lock.json, etc.) from code formatters to prevent CI failures. Release automation tools generate files that may not conform to your formatter's style, causing format checks to fail on subsequent CI runs.",
|
|
240
|
+
"id": "release-artifact-exclusion",
|
|
241
|
+
"label": "Release Artifact Formatter Exclusion",
|
|
242
|
+
"stack": {
|
|
243
|
+
"exampleConfigFiles": [
|
|
244
|
+
".golangci.yml"
|
|
245
|
+
],
|
|
246
|
+
"exampleTools": [
|
|
247
|
+
"gofmt",
|
|
248
|
+
"goreleaser"
|
|
249
|
+
],
|
|
250
|
+
"notes": "Go formatting (gofmt) only affects .go files, so CHANGELOG.md is automatically excluded. If using code generators, exclude generated directories in .golangci.yml skip-dirs.",
|
|
251
|
+
"verification": "Run 'gofmt -d .' and confirm generated code directories are excluded."
|
|
252
|
+
}
|
|
253
|
+
},
|
|
205
254
|
{
|
|
206
255
|
"ciHints": {
|
|
207
256
|
"azure-devops": {
|
|
@@ -1184,5 +1233,5 @@
|
|
|
1184
1233
|
},
|
|
1185
1234
|
"stack": "go",
|
|
1186
1235
|
"stackLabel": "Go",
|
|
1187
|
-
"version":
|
|
1236
|
+
"version": 5
|
|
1188
1237
|
}
|
|
@@ -202,6 +202,55 @@
|
|
|
202
202
|
"verification": "Check that git tags follow vMAJOR.MINOR.PATCH format and goreleaser or similar tooling generates releases and changelogs."
|
|
203
203
|
}
|
|
204
204
|
},
|
|
205
|
+
{
|
|
206
|
+
"ciHints": {
|
|
207
|
+
"github-actions": {
|
|
208
|
+
"job": "ci",
|
|
209
|
+
"notes": "Run the version guard in PR workflows against the base ref."
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
"description": "If semantic-release or automated versioning is enabled, block manual edits to canonical version fields in pull requests. Enforce a CI guard (and optional pre-push hook) that fails when version lines change outside the release workflow.",
|
|
213
|
+
"id": "version-guard",
|
|
214
|
+
"label": "Version Guard (Automated Releases)",
|
|
215
|
+
"stack": {
|
|
216
|
+
"exampleConfigFiles": [
|
|
217
|
+
"scripts/check-version-unchanged.sh",
|
|
218
|
+
".github/workflows/ci.yml",
|
|
219
|
+
"azure-pipelines.yml"
|
|
220
|
+
],
|
|
221
|
+
"exampleTools": [
|
|
222
|
+
"goreleaser",
|
|
223
|
+
"git"
|
|
224
|
+
],
|
|
225
|
+
"notes": "Go versioning is tag-driven; only enable the guard if you keep a VERSION file or embed version constants in code. The guard should ensure those fields are not edited manually in PRs.",
|
|
226
|
+
"optionalFiles": [
|
|
227
|
+
"VERSION"
|
|
228
|
+
],
|
|
229
|
+
"verification": "Run the guard and confirm it fails when VERSION or version constants change outside release automation."
|
|
230
|
+
}
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
"ciHints": {
|
|
234
|
+
"github-actions": {
|
|
235
|
+
"job": "ci",
|
|
236
|
+
"notes": "Ensure format:check step uses ignore file that excludes release artifacts."
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
"description": "Exclude auto-generated release artifacts (CHANGELOG.md, package-lock.json, etc.) from code formatters to prevent CI failures. Release automation tools generate files that may not conform to your formatter's style, causing format checks to fail on subsequent CI runs.",
|
|
240
|
+
"id": "release-artifact-exclusion",
|
|
241
|
+
"label": "Release Artifact Formatter Exclusion",
|
|
242
|
+
"stack": {
|
|
243
|
+
"exampleConfigFiles": [
|
|
244
|
+
".golangci.yml"
|
|
245
|
+
],
|
|
246
|
+
"exampleTools": [
|
|
247
|
+
"gofmt",
|
|
248
|
+
"goreleaser"
|
|
249
|
+
],
|
|
250
|
+
"notes": "Go formatting (gofmt) only affects .go files, so CHANGELOG.md is automatically excluded. If using code generators, exclude generated directories in .golangci.yml skip-dirs.",
|
|
251
|
+
"verification": "Run 'gofmt -d .' and confirm generated code directories are excluded."
|
|
252
|
+
}
|
|
253
|
+
},
|
|
205
254
|
{
|
|
206
255
|
"ciHints": {
|
|
207
256
|
"github-actions": {
|
|
@@ -1184,5 +1233,5 @@
|
|
|
1184
1233
|
},
|
|
1185
1234
|
"stack": "go",
|
|
1186
1235
|
"stackLabel": "Go",
|
|
1187
|
-
"version":
|
|
1236
|
+
"version": 5
|
|
1188
1237
|
}
|
|
@@ -225,6 +225,63 @@
|
|
|
225
225
|
"verification": "Check that git tags follow vMAJOR.MINOR.PATCH format and goreleaser or similar tooling generates releases and changelogs."
|
|
226
226
|
}
|
|
227
227
|
},
|
|
228
|
+
{
|
|
229
|
+
"ciHints": {
|
|
230
|
+
"azure-devops": {
|
|
231
|
+
"notes": "Run the version guard in PR validation jobs before merge.",
|
|
232
|
+
"stage": "quality"
|
|
233
|
+
},
|
|
234
|
+
"github-actions": {
|
|
235
|
+
"job": "ci",
|
|
236
|
+
"notes": "Run the version guard in PR workflows against the base ref."
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
"description": "If semantic-release or automated versioning is enabled, block manual edits to canonical version fields in pull requests. Enforce a CI guard (and optional pre-push hook) that fails when version lines change outside the release workflow.",
|
|
240
|
+
"id": "version-guard",
|
|
241
|
+
"label": "Version Guard (Automated Releases)",
|
|
242
|
+
"stack": {
|
|
243
|
+
"exampleConfigFiles": [
|
|
244
|
+
"scripts/check-version-unchanged.sh",
|
|
245
|
+
".github/workflows/ci.yml",
|
|
246
|
+
"azure-pipelines.yml"
|
|
247
|
+
],
|
|
248
|
+
"exampleTools": [
|
|
249
|
+
"goreleaser",
|
|
250
|
+
"git"
|
|
251
|
+
],
|
|
252
|
+
"notes": "Go versioning is tag-driven; only enable the guard if you keep a VERSION file or embed version constants in code. The guard should ensure those fields are not edited manually in PRs.",
|
|
253
|
+
"optionalFiles": [
|
|
254
|
+
"VERSION"
|
|
255
|
+
],
|
|
256
|
+
"verification": "Run the guard and confirm it fails when VERSION or version constants change outside release automation."
|
|
257
|
+
}
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
"ciHints": {
|
|
261
|
+
"azure-devops": {
|
|
262
|
+
"notes": "Ensure format:check step uses ignore file that excludes release artifacts.",
|
|
263
|
+
"stage": "quality"
|
|
264
|
+
},
|
|
265
|
+
"github-actions": {
|
|
266
|
+
"job": "ci",
|
|
267
|
+
"notes": "Ensure format:check step uses ignore file that excludes release artifacts."
|
|
268
|
+
}
|
|
269
|
+
},
|
|
270
|
+
"description": "Exclude auto-generated release artifacts (CHANGELOG.md, package-lock.json, etc.) from code formatters to prevent CI failures. Release automation tools generate files that may not conform to your formatter's style, causing format checks to fail on subsequent CI runs.",
|
|
271
|
+
"id": "release-artifact-exclusion",
|
|
272
|
+
"label": "Release Artifact Formatter Exclusion",
|
|
273
|
+
"stack": {
|
|
274
|
+
"exampleConfigFiles": [
|
|
275
|
+
".golangci.yml"
|
|
276
|
+
],
|
|
277
|
+
"exampleTools": [
|
|
278
|
+
"gofmt",
|
|
279
|
+
"goreleaser"
|
|
280
|
+
],
|
|
281
|
+
"notes": "Go formatting (gofmt) only affects .go files, so CHANGELOG.md is automatically excluded. If using code generators, exclude generated directories in .golangci.yml skip-dirs.",
|
|
282
|
+
"verification": "Run 'gofmt -d .' and confirm generated code directories are excluded."
|
|
283
|
+
}
|
|
284
|
+
},
|
|
228
285
|
{
|
|
229
286
|
"ciHints": {
|
|
230
287
|
"azure-devops": {
|
|
@@ -1328,5 +1385,5 @@
|
|
|
1328
1385
|
},
|
|
1329
1386
|
"stack": "go",
|
|
1330
1387
|
"stackLabel": "Go",
|
|
1331
|
-
"version":
|
|
1388
|
+
"version": 5
|
|
1332
1389
|
}
|
|
@@ -881,6 +881,215 @@
|
|
|
881
881
|
}
|
|
882
882
|
}
|
|
883
883
|
},
|
|
884
|
+
{
|
|
885
|
+
"appliesTo": {
|
|
886
|
+
"stacks": [
|
|
887
|
+
"typescript-js",
|
|
888
|
+
"csharp-dotnet",
|
|
889
|
+
"python",
|
|
890
|
+
"rust",
|
|
891
|
+
"go"
|
|
892
|
+
]
|
|
893
|
+
},
|
|
894
|
+
"ciHints": {
|
|
895
|
+
"azure-devops": {
|
|
896
|
+
"notes": "Run the version guard in PR validation jobs before merge.",
|
|
897
|
+
"stage": "quality"
|
|
898
|
+
},
|
|
899
|
+
"github-actions": {
|
|
900
|
+
"job": "ci",
|
|
901
|
+
"notes": "Run the version guard in PR workflows against the base ref."
|
|
902
|
+
}
|
|
903
|
+
},
|
|
904
|
+
"description": "If semantic-release or automated versioning is enabled, block manual edits to canonical version fields in pull requests. Enforce a CI guard (and optional pre-push hook) that fails when version lines change outside the release workflow.",
|
|
905
|
+
"enforcement": "required",
|
|
906
|
+
"executionStage": "ci-pr",
|
|
907
|
+
"id": "version-guard",
|
|
908
|
+
"label": "Version Guard (Automated Releases)",
|
|
909
|
+
"severity": "error",
|
|
910
|
+
"stackHints": {
|
|
911
|
+
"csharp-dotnet": {
|
|
912
|
+
"exampleConfigFiles": [
|
|
913
|
+
"scripts/check-version-unchanged.sh",
|
|
914
|
+
".github/workflows/ci.yml",
|
|
915
|
+
"azure-pipelines.yml"
|
|
916
|
+
],
|
|
917
|
+
"exampleTools": [
|
|
918
|
+
"GitVersion",
|
|
919
|
+
"git"
|
|
920
|
+
],
|
|
921
|
+
"notes": "When GitVersion or similar tooling computes versions, block manual edits to Directory.Build.props or *.csproj version fields via the version guard. Allow changes only in release automation.",
|
|
922
|
+
"optionalFiles": [
|
|
923
|
+
"Directory.Build.props",
|
|
924
|
+
"*.csproj",
|
|
925
|
+
"VERSION"
|
|
926
|
+
],
|
|
927
|
+
"verification": "Run the guard and confirm it fails when <Version> or <VersionPrefix> changes in props/csproj files."
|
|
928
|
+
},
|
|
929
|
+
"go": {
|
|
930
|
+
"exampleConfigFiles": [
|
|
931
|
+
"scripts/check-version-unchanged.sh",
|
|
932
|
+
".github/workflows/ci.yml",
|
|
933
|
+
"azure-pipelines.yml"
|
|
934
|
+
],
|
|
935
|
+
"exampleTools": [
|
|
936
|
+
"goreleaser",
|
|
937
|
+
"git"
|
|
938
|
+
],
|
|
939
|
+
"notes": "Go versioning is tag-driven; only enable the guard if you keep a VERSION file or embed version constants in code. The guard should ensure those fields are not edited manually in PRs.",
|
|
940
|
+
"optionalFiles": [
|
|
941
|
+
"VERSION"
|
|
942
|
+
],
|
|
943
|
+
"verification": "Run the guard and confirm it fails when VERSION or version constants change outside release automation."
|
|
944
|
+
},
|
|
945
|
+
"python": {
|
|
946
|
+
"exampleConfigFiles": [
|
|
947
|
+
"scripts/check-version-unchanged.sh",
|
|
948
|
+
".github/workflows/ci.yml",
|
|
949
|
+
"azure-pipelines.yml"
|
|
950
|
+
],
|
|
951
|
+
"exampleTools": [
|
|
952
|
+
"semantic-release",
|
|
953
|
+
"git"
|
|
954
|
+
],
|
|
955
|
+
"notes": "Block manual edits to version fields in pyproject.toml or setup.cfg when automated release tooling computes versions from commit history.",
|
|
956
|
+
"optionalFiles": [
|
|
957
|
+
"setup.cfg",
|
|
958
|
+
"setup.py",
|
|
959
|
+
"VERSION"
|
|
960
|
+
],
|
|
961
|
+
"requiredFiles": [
|
|
962
|
+
"pyproject.toml"
|
|
963
|
+
],
|
|
964
|
+
"verification": "Run the guard and confirm it fails when version lines change in pyproject.toml or setup.cfg."
|
|
965
|
+
},
|
|
966
|
+
"rust": {
|
|
967
|
+
"exampleConfigFiles": [
|
|
968
|
+
"scripts/check-version-unchanged.sh",
|
|
969
|
+
".github/workflows/ci.yml",
|
|
970
|
+
"azure-pipelines.yml"
|
|
971
|
+
],
|
|
972
|
+
"exampleTools": [
|
|
973
|
+
"cargo-release",
|
|
974
|
+
"semantic-release",
|
|
975
|
+
"git"
|
|
976
|
+
],
|
|
977
|
+
"notes": "When using cargo-release or semantic-release-cargo, guard against manual edits to Cargo.toml version fields in PRs.",
|
|
978
|
+
"requiredFiles": [
|
|
979
|
+
"Cargo.toml"
|
|
980
|
+
],
|
|
981
|
+
"verification": "Run the guard and confirm it fails when Cargo.toml version changes."
|
|
982
|
+
},
|
|
983
|
+
"typescript-js": {
|
|
984
|
+
"exampleConfigFiles": [
|
|
985
|
+
"scripts/check-version-unchanged.sh",
|
|
986
|
+
".github/workflows/ci.yml",
|
|
987
|
+
"azure-pipelines.yml"
|
|
988
|
+
],
|
|
989
|
+
"exampleTools": [
|
|
990
|
+
"semantic-release",
|
|
991
|
+
"git"
|
|
992
|
+
],
|
|
993
|
+
"notes": "Add a CI step that runs scripts/check-version-unchanged.sh against the PR base ref. This blocks manual edits to package.json version when semantic-release owns versioning. Optionally wire the same script into a pre-push hook for fast feedback.",
|
|
994
|
+
"optionalFiles": [
|
|
995
|
+
"VERSION"
|
|
996
|
+
],
|
|
997
|
+
"requiredFiles": [
|
|
998
|
+
"package.json"
|
|
999
|
+
],
|
|
1000
|
+
"verification": "Run the guard with the PR base ref (for example, origin/main) and confirm it fails when package.json version changes."
|
|
1001
|
+
}
|
|
1002
|
+
}
|
|
1003
|
+
},
|
|
1004
|
+
{
|
|
1005
|
+
"appliesTo": {
|
|
1006
|
+
"stacks": [
|
|
1007
|
+
"typescript-js",
|
|
1008
|
+
"csharp-dotnet",
|
|
1009
|
+
"python",
|
|
1010
|
+
"rust",
|
|
1011
|
+
"go"
|
|
1012
|
+
]
|
|
1013
|
+
},
|
|
1014
|
+
"ciHints": {
|
|
1015
|
+
"azure-devops": {
|
|
1016
|
+
"notes": "Ensure format:check step uses ignore file that excludes release artifacts.",
|
|
1017
|
+
"stage": "quality"
|
|
1018
|
+
},
|
|
1019
|
+
"github-actions": {
|
|
1020
|
+
"job": "ci",
|
|
1021
|
+
"notes": "Ensure format:check step uses ignore file that excludes release artifacts."
|
|
1022
|
+
}
|
|
1023
|
+
},
|
|
1024
|
+
"description": "Exclude auto-generated release artifacts (CHANGELOG.md, package-lock.json, etc.) from code formatters to prevent CI failures. Release automation tools generate files that may not conform to your formatter's style, causing format checks to fail on subsequent CI runs.",
|
|
1025
|
+
"enforcement": "required",
|
|
1026
|
+
"executionStage": "pre-commit",
|
|
1027
|
+
"id": "release-artifact-exclusion",
|
|
1028
|
+
"label": "Release Artifact Formatter Exclusion",
|
|
1029
|
+
"severity": "error",
|
|
1030
|
+
"stackHints": {
|
|
1031
|
+
"csharp-dotnet": {
|
|
1032
|
+
"exampleConfigFiles": [
|
|
1033
|
+
".editorconfig"
|
|
1034
|
+
],
|
|
1035
|
+
"exampleTools": [
|
|
1036
|
+
"dotnet format",
|
|
1037
|
+
"GitVersion"
|
|
1038
|
+
],
|
|
1039
|
+
"notes": "Use .editorconfig to exclude auto-generated files from formatting. GitVersion may generate or modify files that shouldn't be reformatted. Add glob patterns for generated code directories (e.g., **/obj/**, **/bin/**).",
|
|
1040
|
+
"verification": "Run 'dotnet format --verify-no-changes' and confirm generated files are excluded."
|
|
1041
|
+
},
|
|
1042
|
+
"go": {
|
|
1043
|
+
"exampleConfigFiles": [
|
|
1044
|
+
".golangci.yml"
|
|
1045
|
+
],
|
|
1046
|
+
"exampleTools": [
|
|
1047
|
+
"gofmt",
|
|
1048
|
+
"goreleaser"
|
|
1049
|
+
],
|
|
1050
|
+
"notes": "Go formatting (gofmt) only affects .go files, so CHANGELOG.md is automatically excluded. If using code generators, exclude generated directories in .golangci.yml skip-dirs.",
|
|
1051
|
+
"verification": "Run 'gofmt -d .' and confirm generated code directories are excluded."
|
|
1052
|
+
},
|
|
1053
|
+
"python": {
|
|
1054
|
+
"exampleConfigFiles": [
|
|
1055
|
+
"pyproject.toml"
|
|
1056
|
+
],
|
|
1057
|
+
"exampleTools": [
|
|
1058
|
+
"black",
|
|
1059
|
+
"ruff",
|
|
1060
|
+
"bumpversion"
|
|
1061
|
+
],
|
|
1062
|
+
"notes": "In pyproject.toml [tool.black] or [tool.ruff], add extend-exclude patterns for auto-generated files like CHANGELOG.md. Some versioning tools generate or modify files that should not be reformatted.",
|
|
1063
|
+
"verification": "Run 'black --check .' or 'ruff format --check' and confirm generated files are excluded."
|
|
1064
|
+
},
|
|
1065
|
+
"rust": {
|
|
1066
|
+
"exampleConfigFiles": [
|
|
1067
|
+
"rustfmt.toml"
|
|
1068
|
+
],
|
|
1069
|
+
"exampleTools": [
|
|
1070
|
+
"rustfmt",
|
|
1071
|
+
"cargo-release"
|
|
1072
|
+
],
|
|
1073
|
+
"notes": "Rust rarely has auto-generated source files, but if using tools that generate Rust code, exclude those directories in rustfmt.toml. CHANGELOG.md isn't checked by rustfmt (it only checks .rs files).",
|
|
1074
|
+
"verification": "Run 'cargo fmt --check' and confirm it passes after releases."
|
|
1075
|
+
},
|
|
1076
|
+
"typescript-js": {
|
|
1077
|
+
"exampleConfigFiles": [
|
|
1078
|
+
".prettierignore",
|
|
1079
|
+
".releaserc.json"
|
|
1080
|
+
],
|
|
1081
|
+
"exampleTools": [
|
|
1082
|
+
"prettier",
|
|
1083
|
+
"semantic-release"
|
|
1084
|
+
],
|
|
1085
|
+
"notes": "Add CHANGELOG.md and package-lock.json to .prettierignore. These files are auto-generated by semantic-release and npm respectively. Without this exclusion, format:check fails after releases because the generated format differs from Prettier's expected style. Document each exclusion with a comment explaining it's auto-generated.",
|
|
1086
|
+
"requiredFiles": [
|
|
1087
|
+
".prettierignore"
|
|
1088
|
+
],
|
|
1089
|
+
"verification": "Run 'npm run format:check' and confirm CHANGELOG.md is not checked. Review .prettierignore and confirm auto-generated files are listed with explanatory comments."
|
|
1090
|
+
}
|
|
1091
|
+
}
|
|
1092
|
+
},
|
|
884
1093
|
{
|
|
885
1094
|
"appliesTo": {
|
|
886
1095
|
"stacks": [
|
|
@@ -4497,5 +4706,5 @@
|
|
|
4497
4706
|
"languageFamily": "js"
|
|
4498
4707
|
}
|
|
4499
4708
|
},
|
|
4500
|
-
"version":
|
|
4709
|
+
"version": 5
|
|
4501
4710
|
}
|