KCL: Change core sketch functions to use keyword args #3253
static-analysis.yml
on: pull_request
yarn-fmt-check
37s
yarn-build-wasm
8m 38s
yarn-tsc
5m 18s
yarn-lint
59s
python-codespell
12s
yarn-unit-test-kcl-samples
9m 2s
yarn-unit-test
10m 22s
Annotations
13 errors and 5 warnings
yarn-lint
Process completed with exit code 1.
|
src/lang/kclSamples.test.ts > Test KCL Samples from public Github repository > when performing enginelessExecutor > should run through all the files:
src/lang/wasm.ts#L553
{
stack: 'Error: \n' +
' at Module.executor (/home/runner/work/modeling-app/modeling-app/src/lang/wasm.ts:553:22)\n' +
' at processTicksAndRejections (node:internal/process/task_queues:105:5)\n' +
' at Module.enginelessExecutor (/home/runner/work/modeling-app/modeling-app/src/lib/testHelpers.ts:93:21)\n' +
' at /home/runner/work/modeling-app/modeling-app/src/lang/kclSamples.test.ts:73:11\n' +
' at runTest (file:///home/runner/work/modeling-app/modeling-app/node_modules/@vitest/runner/dist/index.js:781:11)\n' +
' at runSuite (file:///home/runner/work/modeling-app/modeling-app/node_modules/@vitest/runner/dist/index.js:909:15)\n' +
' at runSuite (file:///home/runner/work/modeling-app/modeling-app/node_modules/@vitest/runner/dist/index.js:909:15)\n' +
' at runSuite (file:///home/runner/work/modeling-app/modeling-app/node_modules/@vitest/runner/dist/index.js:909:15)\n' +
' at runFiles (file:///home/runner/work/modeling-app/modeling-app/node_modules/@vitest/runner/dist/index.js:958:5)\n' +
' at startTests (file:///home/runner/work/modeling-app/modeling-app/node_modules/@vitest/runner/dist/index.js:967:3)',
kind: 'semantic',
sourceRange: [ 5613, 5623, true ],
msg: 'Expected a kcl_lib::execution::SketchSet but found number',
operations: [
{
type: 'UserDefinedFunctionCall',
name: 'rail8020',
functionSourceRange: [Array],
unlabeledArg: null,
labeledArgs: {},
sourceRange: [Array]
},
{
type: 'StdLibCall',
name: 'startSketchOn',
unlabeledArg: null,
labeledArgs: [Object],
sourceRange: [Array]
},
{
type: 'StdLibCall',
name: 'hole',
unlabeledArg: null,
labeledArgs: [Object],
sourceRange: [Array]
},
{
type: 'StdLibCall',
name: 'extrude',
unlabeledArg: null,
labeledArgs: [Object],
sourceRange: [Array],
isError: true
}
],
artifactCommands: [
{
cmdId: 'b604e777-1d16-4256-bae1-7560b4315c48',
range: [Array],
command: [Object]
},
{
cmdId: '9ab0191b-129c-467e-bb0a-9d73b103c598',
range: [Array],
command: [Object]
},
{
cmdId: 'a7817b95-c590-4b6a-a7bd-922a56146f9d',
range: [Array],
command: [Object]
},
{
cmdId: 'efff6190-29c0-4411-8cab-801618bc2526',
range: [Array],
command: [Object]
}
],
stackStr: 'Error: \n' +
' at Module.executor (/home/runner/work/modeling-app/modeling-app/src/lang/wasm.ts:553:22)\n' +
' at processTicksAndRejections (node:internal/process/task_queues:105:5)\n' +
' at Module.enginelessExecutor (/home/runner/work/modeling-app/modeling-app/src/lib/testHelpers.ts:93:21)\n' +
' at /home/runner/work/modeling-app/modeling-app/src/lang/kclSamples.test.ts:73:11\n' +
' at runTest (file:///home/runner/work/modeling-app/modeling-app/node_modules/@vitest/runner/dist/index.js:781:11)\n' +
' at runSuite (file:///home/runner/work/modeling-app/modeling-app/node_modules/@vitest/runner/dist/index.js:909:15)\n' +
' at runSuite (file:///home/runner/work/modeling-app/modeling-app/node_modules/@vitest/runner/dist/index.js:909:15)\n' +
' at runSuite (file:///home/runner/work/modeling-app/modeling-app/node_modules/@vitest/runner/dist/index.js:909:15)\n' +
' at runFiles (file:///home/runner/work/modeling-app/modeling-app/node_modules/@vitest/runner/dist/index.js:958:5)\n' +
' at startTests (file:///home/runner/work/modeling-app/modeling-app/node_modules/@vitest/runner/dist/index.js:967:3)',
nameStr: 'Error',
expected: 'undefined',
actual: 'undefined',
message: '',
constructor: 'Function<KCLError>',
name: 'Error',
toString: 'Function<toString>',
stacks: [
{
method: 'Module.executor',
file: '/home/runner/work/modeling-app/modeling-app/src/lang/wasm.ts',
line: 553,
column: 22
},
{
method: 'Module.enginelessExecutor',
file: '/home/runner/work/modeling-app/modeling-app/src/lib
|
yarn-unit-test-kcl-samples
Process completed with exit code 1.
|
src/lang/artifact.test.ts > testing artifacts > sketch artifacts:
src/lang/artifact.test.ts#L20
AssertionError: expected { type: 'Sketch', value: { …(6) } } to deeply equal { type: 'Sketch', value: { …(6) } }
- Expected
+ Received
Object {
"type": "Sketch",
"value": Object {
"__meta": Array [
Object {
"sourceRange": Array [
46,
71,
0,
],
},
],
"id": Any<String>,
"on": Any<Object>,
"paths": Array [
Object {
"__geoMeta": Object {
"id": Any<String>,
"sourceRange": Array [
77,
- 102,
+ 111,
0,
],
},
"from": Array [
0,
0,
],
"tag": null,
"to": Array [
-1.59,
-1.54,
],
"type": "ToPoint",
},
Object {
"__geoMeta": Object {
"id": Any<String>,
"sourceRange": Array [
- 108,
- 132,
+ 117,
+ 150,
0,
],
},
"from": Array [
-1.59,
-1.54,
],
"tag": null,
"to": Array [
0.46,
-5.82,
],
"type": "ToPoint",
},
],
"start": Object {
"__geoMeta": Object {
"id": Any<String>,
"sourceRange": Array [
46,
71,
0,
],
},
"from": Array [
0,
0,
],
"tag": null,
"to": Array [
0,
0,
],
},
"type": "Sketch",
},
}
❯ src/lang/artifact.test.ts:20:23
|
src/lang/artifact.test.ts > testing artifacts > extrude artifacts:
src/lang/artifact.test.ts#L73
AssertionError: expected { type: 'Solid', …(7) } to deeply equal { Object (type, id, ...) }
- Expected
+ Received
Object {
"__meta": Array [
Object {
"sourceRange": Array [
46,
71,
0,
],
},
],
"endCapId": Any<String>,
"height": 2,
"id": Any<String>,
"sketch": Object {
"__meta": Any<Array>,
"id": Any<String>,
"on": Any<Object>,
"paths": Array [
Object {
"__geoMeta": Object {
"id": Any<String>,
"sourceRange": Array [
77,
- 102,
+ 111,
0,
],
},
"from": Array [
0,
0,
],
"tag": null,
"to": Array [
-1.59,
-1.54,
],
"type": "ToPoint",
},
Object {
"__geoMeta": Object {
"id": Any<String>,
"sourceRange": Array [
- 108,
- 132,
+ 117,
+ 150,
0,
],
},
"from": Array [
-1.59,
-1.54,
],
"tag": null,
"to": Array [
0.46,
-5.82,
],
"type": "ToPoint",
},
],
"start": Any<Object>,
"type": "Sketch",
},
"startCapId": Any<String>,
"type": "Solid",
"value": Array [
Object {
"faceId": Any<String>,
"id": Any<String>,
"sourceRange": Array [
77,
- 102,
+ 111,
0,
],
"tag": null,
"type": "extrudePlane",
},
Object {
"faceId": Any<String>,
"id": Any<String>,
"sourceRange": Array [
- 108,
- 132,
+ 117,
+ 150,
0,
],
"tag": null,
"type": "extrudePlane",
},
],
}
❯ src/lang/artifact.test.ts:73:23
|
src/lang/artifact.test.ts > testing artifacts > sketch extrude and sketch on one of the faces:
src/lang/artifact.test.ts#L154
AssertionError: expected [ { type: 'Solid', …(7) }, …(1) ] to deeply equal [ { type: 'Solid', …(7) }, …(1) ]
- Expected
+ Received
Array [
Object {
"__meta": Array [
Object {
"sourceRange": Array [
38,
63,
0,
],
},
],
"endCapId": Any<String>,
"height": 2,
"id": Any<String>,
"sketch": Object {
"__meta": Any<Array>,
"id": Any<String>,
"on": Any<Object>,
"paths": Array [
Object {
"__geoMeta": Object {
"id": Any<String>,
"sourceRange": Array [
69,
- 89,
+ 98,
0,
],
},
"from": Array [
0,
0,
],
"tag": null,
"to": Array [
-2.5,
0,
],
"type": "ToPoint",
},
Object {
"__geoMeta": Object {
"id": Any<String>,
"sourceRange": Array [
- 95,
- 117,
+ 104,
+ 141,
0,
],
},
"from": Array [
-2.5,
0,
],
"tag": Object {
- "end": 116,
- "start": 114,
+ "end": 140,
+ "start": 138,
"type": "TagDeclarator",
"value": "p",
},
"to": Array [
0,
10,
],
"type": "ToPoint",
},
Object {
"__geoMeta": Object {
"id": Any<String>,
"sourceRange": Array [
- 123,
- 142,
+ 147,
+ 175,
0,
],
},
"from": Array [
0,
10,
],
"tag": null,
"to": Array [
2.5,
0,
],
"type": "ToPoint",
},
],
"start": Any<Object>,
"tags": Object {
"p": Object {
"__meta": Array [
Object {
"sourceRange": Array [
- 114,
- 116,
+ 138,
+ 140,
0,
],
},
],
"info": Any<Object>,
"type": "TagIdentifier",
"value": "p",
},
},
"type": "Sketch",
},
"startCapId": Any<String>,
"type": "Solid",
"value": Array [
Object {
"faceId": Any<String>,
"id": Any<String>,
"sourceRange": Array [
69,
- 89,
+ 98,
0,
],
"tag": null,
"type": "extrudePlane",
},
Object {
"faceId": Any<String>,
"id": Any<String>,
"sourceRange": Array [
- 95,
- 117,
+ 104,
+ 141,
0,
],
"tag": Object {
- "end": 116,
- "start": 114,
+ "end": 140,
+ "start": 138,
"type": "TagDeclarator",
"value": "p",
},
"type": "extrudePlane",
},
Object {
"faceId": Any<String>,
"id": Any<String>,
"sourceRange": Array [
- 123,
- 142,
+ 147,
+ 175,
0,
],
"tag": null,
"type": "extrudePlane",
},
],
},
Object {
"__meta": Array [
Object {
"sourceRange": Array [
- 342,
- 367,
+ 384,
+ 409,
0,
],
},
],
"endCapId": Any<String>,
"height": 2,
"id": Any<String>,
"sketch": Object {
"__meta": Any<Array>,
"id": Any<String>,
"on": Any<Ob
|
src/lang/executor.test.ts > test executor > sketch declaration:
src/lang/executor.test.ts#L68
AssertionError: expected [ { type: 'ToPoint', …(4) }, …(2) ] to deeply equal [ { type: 'ToPoint', …(4) }, …(2) ]
- Expected
+ Received
Array [
Object {
"__geoMeta": Object {
"id": Any<String>,
"sourceRange": Array [
72,
- 97,
+ 112,
0,
],
},
"from": Array [
0,
0,
],
"tag": Object {
- "end": 96,
- "start": 89,
+ "end": 111,
+ "start": 104,
"type": "TagDeclarator",
"value": "myPath",
},
"to": Array [
0,
2,
],
"type": "ToPoint",
},
Object {
"__geoMeta": Object {
"id": Any<String>,
"sourceRange": Array [
- 103,
- 119,
+ 118,
+ 143,
0,
],
},
"from": Array [
0,
2,
],
"tag": null,
"to": Array [
2,
3,
],
"type": "ToPoint",
},
Object {
"__geoMeta": Object {
"id": Any<String>,
"sourceRange": Array [
- 125,
- 154,
+ 149,
+ 193,
0,
],
},
"from": Array [
2,
3,
],
"tag": Object {
- "end": 153,
- "start": 143,
+ "end": 192,
+ "start": 182,
"type": "TagDeclarator",
"value": "rightPath",
},
"to": Array [
5,
-1,
],
"type": "ToPoint",
},
]
❯ src/lang/executor.test.ts:68:22
|
src/lang/executor.test.ts > test executor > execute pipe sketch into call expression:
src/lang/executor.test.ts#L158
AssertionError: expected { type: 'Sketch', value: { …(7) } } to deeply equal { type: 'Sketch', value: { …(7) } }
- Expected
+ Received
Object {
"type": "Sketch",
"value": Object {
"__meta": Array [
Object {
"sourceRange": Array [
39,
63,
0,
],
},
],
"id": Any<String>,
"on": Any<Object>,
"paths": Array [
Object {
"__geoMeta": Object {
"id": Any<String>,
"sourceRange": Array [
69,
- 85,
+ 94,
0,
],
},
"from": Array [
0,
0,
],
"tag": null,
"to": Array [
1,
1,
],
"type": "ToPoint",
},
Object {
"__geoMeta": Object {
"id": Any<String>,
"sourceRange": Array [
- 91,
- 117,
+ 100,
+ 141,
0,
],
},
"from": Array [
1,
1,
],
"tag": Object {
- "end": 116,
- "start": 109,
+ "end": 140,
+ "start": 133,
"type": "TagDeclarator",
"value": "myPath",
},
"to": Array [
0,
1,
],
"type": "ToPoint",
},
Object {
"__geoMeta": Object {
"id": Any<String>,
"sourceRange": Array [
- 123,
- 139,
+ 147,
+ 172,
0,
],
},
"from": Array [
0,
1,
],
"tag": null,
"to": Array [
1,
1,
],
"type": "ToPoint",
},
],
"start": Object {
"__geoMeta": Object {
"id": Any<String>,
"sourceRange": Array [
39,
63,
0,
],
},
"from": Array [
0,
0,
],
"tag": null,
"to": Array [
0,
0,
],
},
"tags": Object {
"myPath": Object {
"__meta": Array [
Object {
"sourceRange": Array [
- 109,
- 116,
+ 133,
+ 140,
0,
],
},
],
"info": Any<Object>,
"type": "TagIdentifier",
"value": "myPath",
},
},
"type": "Sketch",
},
}
❯ src/lang/executor.test.ts:158:30
|
src/lang/executor.test.ts > testing math operators > test that % substitution feeds down CallExp->ArrExp->UnaryExp->CallExp:
src/lang/wasm.ts#L553
{
stack: 'Error: \n' +
' at Module.executor (/home/runner/work/modeling-app/modeling-app/src/lang/wasm.ts:553:22)\n' +
' at Module.enginelessExecutor (/home/runner/work/modeling-app/modeling-app/src/lib/testHelpers.ts:93:21)\n' +
' at exe (/home/runner/work/modeling-app/modeling-app/src/lang/executor.test.ts:499:21)\n' +
' at /home/runner/work/modeling-app/modeling-app/src/lang/executor.test.ts:439:17\n' +
' at runTest (file:///home/runner/work/modeling-app/modeling-app/node_modules/@vitest/runner/dist/index.js:781:11)\n' +
' at runSuite (file:///home/runner/work/modeling-app/modeling-app/node_modules/@vitest/runner/dist/index.js:909:15)\n' +
' at runSuite (file:///home/runner/work/modeling-app/modeling-app/node_modules/@vitest/runner/dist/index.js:909:15)\n' +
' at runFiles (file:///home/runner/work/modeling-app/modeling-app/node_modules/@vitest/runner/dist/index.js:958:5)\n' +
' at startTests (file:///home/runner/work/modeling-app/modeling-app/node_modules/@vitest/runner/dist/index.js:967:3)\n' +
' at file:///home/runner/work/modeling-app/modeling-app/node_modules/vitest/dist/chunks/runtime-runBaseTests.oAvMKtQC.js:116:7',
kind: 'semantic',
sourceRange: [ 131, 195, true ],
msg: 'Expected a kcl_lib::execution::Sketch but found array (list)',
operations: [
{
type: 'StdLibCall',
name: 'startSketchOn',
unlabeledArg: null,
labeledArgs: [Object],
sourceRange: [Array]
}
],
artifactCommands: [
{
cmdId: '15ef88e0-da1d-45b0-94b2-aacb6095d65d',
range: [Array],
command: [Object]
},
{
cmdId: '0b58f73a-bd1f-4f91-ae2e-0768f807bc10',
range: [Array],
command: [Object]
},
{
cmdId: 'd967d505-5327-4a12-b3d8-7b8503a9901e',
range: [Array],
command: [Object]
},
{
cmdId: '24620bef-cc44-4b81-8bf2-f468eec84bdd',
range: [Array],
command: [Object]
}
],
stackStr: 'Error: \n' +
' at Module.executor (/home/runner/work/modeling-app/modeling-app/src/lang/wasm.ts:553:22)\n' +
' at Module.enginelessExecutor (/home/runner/work/modeling-app/modeling-app/src/lib/testHelpers.ts:93:21)\n' +
' at exe (/home/runner/work/modeling-app/modeling-app/src/lang/executor.test.ts:499:21)\n' +
' at /home/runner/work/modeling-app/modeling-app/src/lang/executor.test.ts:439:17\n' +
' at runTest (file:///home/runner/work/modeling-app/modeling-app/node_modules/@vitest/runner/dist/index.js:781:11)\n' +
' at runSuite (file:///home/runner/work/modeling-app/modeling-app/node_modules/@vitest/runner/dist/index.js:909:15)\n' +
' at runSuite (file:///home/runner/work/modeling-app/modeling-app/node_modules/@vitest/runner/dist/index.js:909:15)\n' +
' at runFiles (file:///home/runner/work/modeling-app/modeling-app/node_modules/@vitest/runner/dist/index.js:958:5)\n' +
' at startTests (file:///home/runner/work/modeling-app/modeling-app/node_modules/@vitest/runner/dist/index.js:967:3)\n' +
' at file:///home/runner/work/modeling-app/modeling-app/node_modules/vitest/dist/chunks/runtime-runBaseTests.oAvMKtQC.js:116:7',
nameStr: 'Error',
expected: 'undefined',
actual: 'undefined',
message: '',
constructor: 'Function<KCLError>',
name: 'Error',
toString: 'Function<toString>',
stacks: [
{
method: 'Module.executor',
file: '/home/runner/work/modeling-app/modeling-app/src/lang/wasm.ts',
line: 553,
column: 22
},
{
method: 'Module.enginelessExecutor',
file: '/home/runner/work/modeling-app/modeling-app/src/lib/testHelpers.ts',
line: 93,
column: 21
},
{
method: 'exe',
file: '/home/runner/work/modeling-app/modeling-app/src/lang/executor.test.ts',
line: 499,
column: 21
},
{
method: '',
file: '/home/runner/work/modeling-app/modeling-app/src/lang/executor.test.ts',
line: 439,
column: 17
}
]
}
❯ Module.executor src/lang/wasm.ts:553:22
❯ Module.enginelessExecutor src/l
|
src/lang/getNodePathFromSourceRange.test.ts > testing getNodePathFromSourceRange > test it gets the right path for a `lineTo` CallExpression within a SketchExpression:
src/lang/getNodePathFromSourceRange.test.ts#L33
AssertionError: expected 'CallExpressionKw' to be 'CallExpression' // Object.is equality
- Expected
+ Received
- CallExpression
+ CallExpressionKw
❯ src/lang/getNodePathFromSourceRange.test.ts:33:23
|
src/lang/getNodePathFromSourceRange.test.ts > testing getNodePathFromSourceRange > gets path right for deep within function definition body:
src/lang/getNodePathFromSourceRange.test.ts#L95
AssertionError: expected [ [ 'body', '' ], …(15) ] to deeply equal [ [ 'body', '' ], …(14) ]
- Expected
+ Received
Array [
Array [
"body",
"",
],
Array [
0,
"index",
],
Array [
"declaration",
"VariableDeclaration",
],
Array [
"init",
"",
],
Array [
"body",
"FunctionExpression",
],
Array [
"body",
"FunctionExpression",
],
Array [
0,
"index",
],
Array [
"declaration",
"VariableDeclaration",
],
Array [
"init",
"",
],
Array [
"body",
"PipeExpression",
],
Array [
2,
"index",
],
Array [
"arguments",
- "CallExpression",
+ "CallExpressionKw",
],
Array [
0,
- "index",
+ "arg index",
+ ],
+ Array [
+ "arg",
+ "LabeledArg -> Arg",
],
Array [
"elements",
"ArrayExpression",
],
Array [
0,
"index",
],
]
❯ src/lang/getNodePathFromSourceRange.test.ts:95:22
|
src/lang/modifyAst.test.ts > Testing addSketchTo > should add a sketch to a program:
src/lang/modifyAst.test.ts#L135
AssertionError: expected 'sketch001 = startSketchOn(\'YZ\')\n …' to be 'sketch001 = startSketchOn(\'YZ\')\n …' // Object.is equality
- Expected
+ Received
sketch001 = startSketchOn('YZ')
|> startProfileAt('default', %)
- |> line(end = 'default')
+ |> line(%, end = 'default')
❯ src/lang/modifyAst.test.ts:135:17
|
src/lang/modifyAst.test.ts > Testing giveSketchFnCallTag > Should return existing tag if it already exists:
src/lang/modifyAst.test.ts#L199
AssertionError: expected 'part001 = startSketchOn(\'XY\')\n |>…' to contain 'line(end = [-2.57, -0.13], tag = $but…'
- Expected
+ Received
- line(end = [-2.57, -0.13], tag = $butts)
+ part001 = startSketchOn('XY')
+ |> startProfileAt([0, 0], %)
+ |> line(end = [-2.57, -0.13], tag = $butts, tag = $butts)
+ |> line(end = [0, 0.83])
+ |> line(end = [0.82, 0.34])
+
❯ src/lang/modifyAst.test.ts:199:21
|
python-codespell
The `python-version` input is not set. The version of Python currently in `PATH` will be used.
|
yarn-lint:
src/lang/std/sketchcombos.ts#L1997
Expected '===' and instead saw '=='
|
yarn-lint:
src/lang/std/sketchcombos.ts#L1997
Expected '===' and instead saw '=='
|
yarn-unit-test-kcl-samples
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
|
yarn-unit-test
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
|