Skip to content

armgit / kiln

Public Imported from GitHub
0

Build and revise procedural 3D assets with your coding agent. Local MCP server, CLI and TypeScript engine with rendered review, editable source and GLB export.

ci: limit cognitive complexity to 100 (#330)

Matthew Kissinger14bff0fc273a
diff --git a/biome.json b/biome.json
index 58d4ff51..2601ee13 100644
--- a/biome.json
+++ b/biome.json
@@ -31,7 +31,14 @@
"rules": {
"preset": "recommended",
"style": { "noNonNullAssertion": "off", "useTemplate": "error" },
- "complexity": { "useLiteralKeys": "off", "useOptionalChain": "error" },
+ "complexity": {
+ "useLiteralKeys": "off",
+ "useOptionalChain": "error",
+ "noExcessiveCognitiveComplexity": {
+ "level": "error",
+ "options": { "maxAllowedComplexity": 100 }
+ }
+ },
"correctness": { "noUnusedImports": "error" },
"suspicious": {
"noApproximativeNumericConstant": "error",
@@ -41,5 +48,176 @@
}
}
},
- "assist": { "enabled": false }
+ "assist": { "enabled": false },
+ "overrides": [
+ {
+ "includes": ["src/asset-cli.ts"],
+ "linter": {
+ "rules": {
+ "complexity": {
+ "noExcessiveCognitiveComplexity": {
+ "level": "error",
+ "options": { "maxAllowedComplexity": 255 }
+ }
+ }
+ }
+ }
+ },
+ {
+ "includes": ["src/qa/requirements-run.ts"],
+ "linter": {
+ "rules": {
+ "complexity": {
+ "noExcessiveCognitiveComplexity": {
+ "level": "error",
+ "options": { "maxAllowedComplexity": 255 }
+ }
+ }
+ }
+ }
+ },
+ {
+ "includes": ["src/qa/atlas.ts"],
+ "linter": {
+ "rules": {
+ "complexity": {
+ "noExcessiveCognitiveComplexity": {
+ "level": "error",
+ "options": { "maxAllowedComplexity": 232 }
+ }
+ }
+ }
+ }
+ },
+ {
+ "includes": ["src/views/glb.ts"],
+ "linter": {
+ "rules": {
+ "complexity": {
+ "noExcessiveCognitiveComplexity": {
+ "level": "error",
+ "options": { "maxAllowedComplexity": 182 }
+ }
+ }
+ }
+ }
+ },
+ {
+ "includes": ["scripts/workspace-project.mjs"],
+ "linter": {
+ "rules": {
+ "complexity": {
+ "noExcessiveCognitiveComplexity": {
+ "level": "error",
+ "options": { "maxAllowedComplexity": 168 }
+ }
+ }
+ }
+ }
+ },
+ {
+ "includes": ["src/assembly.ts"],
+ "linter": {
+ "rules": {
+ "complexity": {
+ "noExcessiveCognitiveComplexity": {
+ "level": "error",
+ "options": { "maxAllowedComplexity": 159 }
+ }
+ }
+ }
+ }
+ },
+ {
+ "includes": ["src/ops.ts"],
+ "linter": {
+ "rules": {
+ "complexity": {
+ "noExcessiveCognitiveComplexity": {
+ "level": "error",
+ "options": { "maxAllowedComplexity": 122 }
+ }
+ }
+ }
+ }
+ },
+ {
+ "includes": ["scripts/create-workspace.mjs"],
+ "linter": {
+ "rules": {
+ "complexity": {
+ "noExcessiveCognitiveComplexity": {
+ "level": "error",
+ "options": { "maxAllowedComplexity": 116 }
+ }
+ }
+ }
+ }
+ },
+ {
+ "includes": ["src/project-cli.ts"],
+ "linter": {
+ "rules": {
+ "complexity": {
+ "noExcessiveCognitiveComplexity": {
+ "level": "error",
+ "options": { "maxAllowedComplexity": 113 }
+ }
+ }
+ }
+ }
+ },
+ {
+ "includes": ["src/geometry-export.ts"],
+ "linter": {
+ "rules": {
+ "complexity": {
+ "noExcessiveCognitiveComplexity": {
+ "level": "error",
+ "options": { "maxAllowedComplexity": 112 }
+ }
+ }
+ }
+ }
+ },
+ {
+ "includes": ["src/simplify.ts"],
+ "linter": {
+ "rules": {
+ "complexity": {
+ "noExcessiveCognitiveComplexity": {
+ "level": "error",
+ "options": { "maxAllowedComplexity": 109 }
+ }
+ }
+ }
+ }
+ },
+ {
+ "includes": ["src/delivery-inspect.ts"],
+ "linter": {
+ "rules": {
+ "complexity": {
+ "noExcessiveCognitiveComplexity": {
+ "level": "error",
+ "options": { "maxAllowedComplexity": 105 }
+ }
+ }
+ }
+ }
+ },
+ {
+ "includes": ["src/render.ts"],
+ "linter": {
+ "rules": {
+ "complexity": {
+ "noExcessiveCognitiveComplexity": {
+ "level": "error",
+ "options": { "maxAllowedComplexity": 104 }
+ }
+ }
+ }
+ }
+ }
+ ]
}
diff --git a/docs/architecture.md b/docs/architecture.md
index c2090511..52e87805 100644
--- a/docs/architecture.md
+++ b/docs/architecture.md
@@ -76,6 +76,6 @@ bun run test:coverage
Prepare the pinned historical corpus once with the explicit fetch command above.
Subsequent tests stay offline, pin CPU rendering and include those archived programs.
-The coverage ratchet lives in [scripts/check-coverage.mjs](https://github.com/instruktlabs/kiln/blob/main/scripts/check-coverage.mjs). Threshold decreases require an explicit measured rationale. Live provider tests require an explicit opt-in.
+The coverage ratchet lives in [scripts/check-coverage.mjs](https://github.com/instruktlabs/kiln/blob/main/scripts/check-coverage.mjs). Threshold decreases require an explicit measured rationale. Biome limits cognitive complexity to 100; `overrides` in `biome.json` hold each of the 13 existing functions above that at its current score, so they cannot grow. Lower a ceiling when its function is refactored. Live provider tests require an explicit opt-in.
Core dependencies include Three.js, glTF Transform, Manifold, Acorn, and Zod. The agent SDK is an optional peer. Keep provider adapters compatible with the SDK's declared interface version; a TypeScript cast cannot fix a runtime protocol mismatch.