microsoft / qsharp

Azure Quantum Development Kit, including the Q# programming language, resource estimator, and Quantum Katas
https://microsoft.github.io/qsharp/
MIT License
367 stars 73 forks source link

Lints and Code Actions for Deprecated UDT Syntax #1660

Closed ScottCarda-MS closed 12 hours ago

ScottCarda-MS commented 5 days ago

Expands the linting framework and adds lints for newtype declarations, references to UDT constructor functions, use of the :: field accessor operator, and use of the w/ and w/= operators for structs. A code action is added to convert uses of w/ and w/= operators with structs to copy constructor syntax, and another code action is added to convert uses of :: to ..

github-actions[bot] commented 5 days ago

Benchmark for 6c40242

Click to view benchmark | Test | Base | PR | % | |------|--------------|------------------|---| | Array append evaluation | 338.8±11.32µs | 331.1±9.81µs | -2.27% | | Array literal evaluation | 181.9±4.82µs | **169.7±4.98µs** | **-6.71%** | | Array update evaluation | 422.5±11.42µs | **409.7±12.91µs** | **-3.03%** | | Core + Standard library compilation | 20.3±0.53ms | 20.7±0.60ms | +1.97% | | Deutsch-Jozsa evaluation | 5.1±0.04ms | 5.1±0.05ms | 0.00% | | Large file parity evaluation | **34.0±0.09ms** | 34.1±0.29ms | **+0.29%** | | Large input file compilation | 13.2±0.62ms | **12.4±0.25ms** | **-6.06%** | | Large input file compilation (interpreter) | 49.6±1.84ms | 49.8±1.32ms | +0.40% | | Large nested iteration | 32.7±0.52ms | **32.1±1.28ms** | **-1.83%** | | Perform Runtime Capabilities Analysis (RCA) on Deutsch-Jozsa sample | 1579.6±40.00µs | 1579.7±117.25µs | +0.01% | | Perform Runtime Capabilities Analysis (RCA) on large file sample | 7.9±0.12ms | 7.9±0.10ms | 0.00% | | Perform Runtime Capabilities Analysis (RCA) on teleport sample | 1429.0±39.80µs | 1429.2±52.33µs | +0.01% | | Perform Runtime Capabilities Analysis (RCA) on the core and std libraries | 28.3±0.34ms | 28.2±0.97ms | -0.35% | | Teleport evaluation | 90.6±3.55µs | 89.9±3.86µs | -0.77% |
github-actions[bot] commented 5 days ago

Benchmark for 7a4a652

Click to view benchmark | Test | Base | PR | % | |------|--------------|------------------|---| | Array append evaluation | **328.3±1.54µs** | 335.1±3.72µs | **+2.07%** | | Array literal evaluation | **181.0±1.04µs** | 186.9±2.38µs | **+3.26%** | | Array update evaluation | **410.7±1.28µs** | 412.9±3.60µs | **+0.54%** | | Core + Standard library compilation | 19.8±0.19ms | 19.9±0.35ms | +0.51% | | Deutsch-Jozsa evaluation | 5.1±0.38ms | 5.1±0.05ms | 0.00% | | Large file parity evaluation | **33.9±0.06ms** | 34.1±0.19ms | **+0.59%** | | Large input file compilation | 12.1±0.09ms | **12.0±0.09ms** | **-0.83%** | | Large input file compilation (interpreter) | 46.9±1.16ms | **46.0±0.52ms** | **-1.92%** | | Large nested iteration | **32.1±0.40ms** | 32.6±1.63ms | **+1.56%** | | Perform Runtime Capabilities Analysis (RCA) on Deutsch-Jozsa sample | 1555.5±27.97µs | 1556.2±27.94µs | +0.05% | | Perform Runtime Capabilities Analysis (RCA) on large file sample | 7.8±0.43ms | **7.7±0.09ms** | **-1.28%** | | Perform Runtime Capabilities Analysis (RCA) on teleport sample | 1416.3±30.87µs | 1414.3±29.01µs | -0.14% | | Perform Runtime Capabilities Analysis (RCA) on the core and std libraries | **27.9±0.64ms** | 28.1±0.14ms | **+0.72%** | | Teleport evaluation | 90.3±3.36µs | 89.1±3.43µs | -1.33% |
github-actions[bot] commented 4 days ago

Benchmark for e922199

Click to view benchmark | Test | Base | PR | % | |------|--------------|------------------|---| | Array append evaluation | 335.5±3.08µs | 336.5±1.62µs | +0.30% | | Array literal evaluation | 200.2±3.39µs | **172.0±1.55µs** | **-14.09%** | | Array update evaluation | 414.6±7.89µs | **408.3±3.78µs** | **-1.52%** | | Core + Standard library compilation | 20.3±0.73ms | 20.1±0.28ms | -0.99% | | Deutsch-Jozsa evaluation | 5.1±0.04ms | 5.1±0.28ms | 0.00% | | Large file parity evaluation | 34.2±0.40ms | 34.3±0.39ms | +0.29% | | Large input file compilation | 12.4±0.21ms | 12.4±0.42ms | 0.00% | | Large input file compilation (interpreter) | 49.7±1.42ms | 49.1±1.18ms | -1.21% | | Large nested iteration | 32.4±0.33ms | **32.0±0.83ms** | **-1.23%** | | Perform Runtime Capabilities Analysis (RCA) on Deutsch-Jozsa sample | 1562.2±31.91µs | 1559.4±51.83µs | -0.18% | | Perform Runtime Capabilities Analysis (RCA) on large file sample | 7.8±0.09ms | 7.8±0.09ms | 0.00% | | Perform Runtime Capabilities Analysis (RCA) on teleport sample | 1429.6±33.24µs | 1418.3±45.20µs | -0.79% | | Perform Runtime Capabilities Analysis (RCA) on the core and std libraries | 28.0±0.50ms | 28.0±0.87ms | 0.00% | | Teleport evaluation | 89.9±4.22µs | 90.9±3.69µs | +1.11% |
github-actions[bot] commented 4 days ago

Benchmark for 1008031

Click to view benchmark | Test | Base | PR | % | |------|--------------|------------------|---| | Array append evaluation | 332.3±1.78µs | **328.9±1.64µs** | **-1.02%** | | Array literal evaluation | 192.4±1.13µs | **171.2±0.75µs** | **-11.02%** | | Array update evaluation | 411.3±1.51µs | **409.2±4.01µs** | **-0.51%** | | Core + Standard library compilation | 21.2±0.40ms | 21.1±0.58ms | -0.47% | | Deutsch-Jozsa evaluation | 5.1±0.15ms | 5.1±0.05ms | 0.00% | | Large file parity evaluation | **34.1±0.07ms** | 34.3±0.34ms | **+0.59%** | | Large input file compilation | 13.0±0.27ms | **12.8±0.19ms** | **-1.54%** | | Large input file compilation (interpreter) | 51.2±1.30ms | 51.3±1.03ms | +0.20% | | Large nested iteration | 32.2±0.27ms | 32.1±1.17ms | -0.31% | | Perform Runtime Capabilities Analysis (RCA) on Deutsch-Jozsa sample | 1573.4±71.21µs | 1578.0±75.81µs | +0.29% | | Perform Runtime Capabilities Analysis (RCA) on large file sample | 7.9±0.16ms | 7.9±0.10ms | 0.00% | | Perform Runtime Capabilities Analysis (RCA) on teleport sample | 1433.0±84.17µs | 1450.3±71.52µs | +1.21% | | Perform Runtime Capabilities Analysis (RCA) on the core and std libraries | 28.4±0.63ms | 28.2±0.59ms | -0.70% | | Teleport evaluation | 91.3±8.55µs | 92.1±8.77µs | +0.88% |
github-actions[bot] commented 3 days ago

Benchmark for 1f1fccc

Click to view benchmark | Test | Base | PR | % | |------|--------------|------------------|---| | Array append evaluation | 330.2±3.32µs | 329.7±3.50µs | -0.15% | | Array literal evaluation | **172.7±6.85µs** | 178.5±4.90µs | **+3.36%** | | Array update evaluation | 409.8±2.77µs | 411.6±2.25µs | +0.44% | | Core + Standard library compilation | 22.4±1.51ms | 21.3±1.21ms | -4.91% | | Deutsch-Jozsa evaluation | 5.2±0.05ms | **5.1±0.13ms** | **-1.92%** | | Large file parity evaluation | 34.5±0.08ms | 34.5±0.11ms | 0.00% | | Large input file compilation | 13.6±0.86ms | **12.3±0.22ms** | **-9.56%** | | Large input file compilation (interpreter) | 55.5±1.95ms | **50.1±2.14ms** | **-9.73%** | | Large nested iteration | 31.9±0.18ms | 31.9±0.74ms | 0.00% | | Perform Runtime Capabilities Analysis (RCA) on Deutsch-Jozsa sample | 2.4±0.03ms | **1626.4±217.26µs** | **-32.23%** | | Perform Runtime Capabilities Analysis (RCA) on large file sample | 8.8±0.12ms | **8.1±0.23ms** | **-7.95%** | | Perform Runtime Capabilities Analysis (RCA) on teleport sample | 2.2±0.03ms | **1425.1±34.04µs** | **-35.22%** | | Perform Runtime Capabilities Analysis (RCA) on the core and std libraries | 29.4±0.92ms | **28.5±0.60ms** | **-3.06%** | | Teleport evaluation | 91.4±3.47µs | 90.3±5.40µs | -1.20% |
github-actions[bot] commented 3 days ago

Benchmark for f501100

Click to view benchmark | Test | Base | PR | % | |------|--------------|------------------|---| | Array append evaluation | **329.7±1.73µs** | 331.2±1.44µs | **+0.45%** | | Array literal evaluation | **172.2±1.30µs** | 189.0±2.64µs | **+9.76%** | | Array update evaluation | 410.4±1.36µs | 409.4±7.77µs | -0.24% | | Core + Standard library compilation | 20.8±0.42ms | 20.5±0.73ms | -1.44% | | Deutsch-Jozsa evaluation | 5.1±0.05ms | 5.1±0.05ms | 0.00% | | Large file parity evaluation | **34.3±0.10ms** | 34.4±0.09ms | **+0.29%** | | Large input file compilation | 12.5±0.20ms | 12.7±0.37ms | +1.60% | | Large input file compilation (interpreter) | 50.5±2.03ms | 49.9±1.08ms | -1.19% | | Large nested iteration | 32.1±1.06ms | 32.1±0.42ms | 0.00% | | Perform Runtime Capabilities Analysis (RCA) on Deutsch-Jozsa sample | 1566.1±44.53µs | 1580.1±43.52µs | +0.89% | | Perform Runtime Capabilities Analysis (RCA) on large file sample | 7.9±0.21ms | 7.9±0.13ms | 0.00% | | Perform Runtime Capabilities Analysis (RCA) on teleport sample | 1429.3±70.18µs | 1447.2±99.80µs | +1.25% | | Perform Runtime Capabilities Analysis (RCA) on the core and std libraries | 28.3±1.01ms | **27.9±0.21ms** | **-1.41%** | | Teleport evaluation | 91.5±4.44µs | 91.0±6.30µs | -0.55% |
github-actions[bot] commented 2 days ago

Benchmark for 344223e

Click to view benchmark | Test | Base | PR | % | |------|--------------|------------------|---| | Array append evaluation | 332.7±2.74µs | **329.0±2.16µs** | **-1.11%** | | Array literal evaluation | 186.3±0.78µs | **171.7±1.51µs** | **-7.84%** | | Array update evaluation | 411.4±1.83µs | 411.7±1.51µs | +0.07% | | Core + Standard library compilation | **21.5±0.82ms** | 22.9±1.12ms | **+6.51%** | | Deutsch-Jozsa evaluation | 5.2±0.06ms | 5.2±0.26ms | 0.00% | | Large file parity evaluation | 34.8±0.96ms | 34.7±0.25ms | -0.29% | | Large input file compilation | **13.0±0.38ms** | 13.4±0.76ms | **+3.08%** | | Large input file compilation (interpreter) | **52.2±1.58ms** | 54.8±1.82ms | **+4.98%** | | Large nested iteration | 32.2±0.34ms | 32.2±0.86ms | 0.00% | | Perform Runtime Capabilities Analysis (RCA) on Deutsch-Jozsa sample | 1594.4±155.57µs | 1603.3±154.70µs | +0.56% | | Perform Runtime Capabilities Analysis (RCA) on large file sample | 8.3±0.45ms | 8.2±0.17ms | -1.20% | | Perform Runtime Capabilities Analysis (RCA) on teleport sample | 1432.6±112.23µs | 1445.5±133.09µs | +0.90% | | Perform Runtime Capabilities Analysis (RCA) on the core and std libraries | **28.5±0.64ms** | 29.2±0.71ms | **+2.46%** | | Teleport evaluation | 91.9±3.72µs | 92.3±4.38µs | +0.44% |
github-actions[bot] commented 2 days ago

Benchmark for ebf2abb

Click to view benchmark | Test | Base | PR | % | |------|--------------|------------------|---| | Array append evaluation | 331.0±2.26µs | **326.7±2.13µs** | **-1.30%** | | Array literal evaluation | 188.8±16.40µs | **170.1±5.09µs** | **-9.90%** | | Array update evaluation | 408.9±2.72µs | 408.4±2.50µs | -0.12% | | Core + Standard library compilation | 21.0±0.80ms | **19.8±0.27ms** | **-5.71%** | | Deutsch-Jozsa evaluation | 5.2±0.07ms | **5.1±0.05ms** | **-1.92%** | | Large file parity evaluation | 34.4±0.11ms | 34.3±0.31ms | -0.29% | | Large input file compilation | 12.6±0.41ms | **12.0±0.13ms** | **-4.76%** | | Large input file compilation (interpreter) | 49.4±1.78ms | **47.9±0.91ms** | **-3.04%** | | Large nested iteration | 32.3±1.45ms | 31.9±0.50ms | -1.24% | | Perform Runtime Capabilities Analysis (RCA) on Deutsch-Jozsa sample | 1551.3±33.37µs | 1545.4±42.17µs | -0.38% | | Perform Runtime Capabilities Analysis (RCA) on large file sample | 7.8±0.10ms | **7.7±0.07ms** | **-1.28%** | | Perform Runtime Capabilities Analysis (RCA) on teleport sample | 1413.6±56.78µs | 1406.9±30.16µs | -0.47% | | Perform Runtime Capabilities Analysis (RCA) on the core and std libraries | 28.4±0.30ms | **27.8±0.37ms** | **-2.11%** | | Teleport evaluation | 93.5±3.63µs | **89.9±3.57µs** | **-3.85%** |
github-actions[bot] commented 2 days ago

Benchmark for cb83176

Click to view benchmark | Test | Base | PR | % | |------|--------------|------------------|---| | Array append evaluation | 371.4±1.64µs | **326.0±1.75µs** | **-12.22%** | | Array literal evaluation | 189.3±0.82µs | **169.6±3.86µs** | **-10.41%** | | Array update evaluation | 439.9±1.52µs | **406.1±2.63µs** | **-7.68%** | | Core + Standard library compilation | 19.8±0.29ms | **19.6±0.14ms** | **-1.01%** | | Deutsch-Jozsa evaluation | 5.2±0.07ms | **5.1±0.05ms** | **-1.92%** | | Large file parity evaluation | 34.4±0.15ms | 34.3±0.15ms | -0.29% | | Large input file compilation | 12.2±0.17ms | **12.0±0.10ms** | **-1.64%** | | Large input file compilation (interpreter) | 47.1±0.74ms | 47.0±0.87ms | -0.21% | | Large nested iteration | 35.4±0.68ms | **31.8±0.20ms** | **-10.17%** | | Perform Runtime Capabilities Analysis (RCA) on Deutsch-Jozsa sample | 1549.2±35.55µs | 1541.6±28.94µs | -0.49% | | Perform Runtime Capabilities Analysis (RCA) on large file sample | 7.7±0.07ms | 7.7±0.06ms | 0.00% | | Perform Runtime Capabilities Analysis (RCA) on teleport sample | 1410.1±32.16µs | 1406.0±30.86µs | -0.29% | | Perform Runtime Capabilities Analysis (RCA) on the core and std libraries | 27.9±0.25ms | 27.8±0.17ms | -0.36% | | Teleport evaluation | 91.6±3.57µs | 91.8±5.06µs | +0.22% |
github-actions[bot] commented 2 days ago

Benchmark for c1b03f4

Click to view benchmark | Test | Base | PR | % | |------|--------------|------------------|---| | Array append evaluation | **326.8±1.24µs** | 330.0±2.98µs | **+0.98%** | | Array literal evaluation | **170.1±1.80µs** | 187.9±10.18µs | **+10.46%** | | Array update evaluation | 408.9±2.11µs | 409.8±2.36µs | +0.22% | | Core + Standard library compilation | 23.4±0.83ms | **20.3±1.02ms** | **-13.25%** | | Deutsch-Jozsa evaluation | **5.1±0.08ms** | 5.2±0.23ms | **+1.96%** | | Large file parity evaluation | 34.3±0.13ms | 34.4±0.31ms | +0.29% | | Large input file compilation | 12.7±0.39ms | 12.5±0.53ms | -1.57% | | Large input file compilation (interpreter) | 52.5±1.74ms | **47.6±1.03ms** | **-9.33%** | | Large nested iteration | 32.0±0.52ms | 32.2±0.30ms | +0.62% | | Perform Runtime Capabilities Analysis (RCA) on Deutsch-Jozsa sample | 1563.1±67.08µs | 1545.0±31.28µs | -1.16% | | Perform Runtime Capabilities Analysis (RCA) on large file sample | 7.8±0.18ms | 7.8±0.12ms | 0.00% | | Perform Runtime Capabilities Analysis (RCA) on teleport sample | 1417.8±45.33µs | 1404.9±30.24µs | -0.91% | | Perform Runtime Capabilities Analysis (RCA) on the core and std libraries | 28.3±0.50ms | 28.0±1.23ms | -1.06% | | Teleport evaluation | 90.6±3.65µs | 91.1±3.83µs | +0.55% |
billti commented 1 day ago

Will the linting be 'off' by default? Is this is brand new syntax, seems like we should give people a couple releases to migrate before we start populating the problem list with warnings.

github-actions[bot] commented 1 day ago

Benchmark for c223956

Click to view benchmark | Test | Base | PR | % | |------|--------------|------------------|---| | Array append evaluation | **328.0±3.04µs** | 333.2±4.93µs | **+1.59%** | | Array literal evaluation | **171.0±1.58µs** | 187.6±2.26µs | **+9.71%** | | Array update evaluation | **411.8±3.83µs** | 418.8±15.35µs | **+1.70%** | | Core + Standard library compilation | **20.5±0.45ms** | 23.5±1.29ms | **+14.63%** | | Deutsch-Jozsa evaluation | 5.2±0.06ms | 5.2±0.10ms | 0.00% | | Large file parity evaluation | **35.2±0.23ms** | 35.5±0.46ms | **+0.85%** | | Large input file compilation | 13.5±0.84ms | 13.3±0.46ms | -1.48% | | Large input file compilation (interpreter) | 54.0±1.85ms | 54.7±1.79ms | +1.30% | | Large nested iteration | **32.1±0.45ms** | 32.9±0.35ms | **+2.49%** | | Perform Runtime Capabilities Analysis (RCA) on Deutsch-Jozsa sample | 1608.5±46.09µs | 1623.9±137.75µs | +0.96% | | Perform Runtime Capabilities Analysis (RCA) on large file sample | 8.1±0.20ms | 8.1±0.17ms | 0.00% | | Perform Runtime Capabilities Analysis (RCA) on teleport sample | 1473.3±93.99µs | 1482.5±111.66µs | +0.62% | | Perform Runtime Capabilities Analysis (RCA) on the core and std libraries | 28.4±0.68ms | 28.9±0.59ms | +1.76% | | Teleport evaluation | 91.4±3.98µs | 91.1±6.19µs | -0.33% |
ScottCarda-MS commented 1 day ago

Will the linting be 'off' by default? Is this is brand new syntax, seems like we should give people a couple releases to migrate before we start populating the problem list with warnings.

I've set the default lint level to "Allow" for the new lints, effectively disabling them for anyone who doesn't specifically overwrite the lint levels in their project config file.

github-actions[bot] commented 1 day ago

Benchmark for 4da68a4

Click to view benchmark | Test | Base | PR | % | |------|--------------|------------------|---| | Array append evaluation | 328.2±3.86µs | 330.4±3.42µs | +0.67% | | Array literal evaluation | 169.2±1.57µs | 168.2±1.18µs | -0.59% | | Array update evaluation | **407.8±1.81µs** | 411.9±3.29µs | **+1.01%** | | Core + Standard library compilation | 19.7±0.05ms | **19.5±0.08ms** | **-1.02%** | | Deutsch-Jozsa evaluation | 5.2±0.06ms | **5.1±0.04ms** | **-1.92%** | | Large file parity evaluation | **34.3±0.12ms** | 34.5±0.77ms | **+0.58%** | | Large input file compilation | 12.0±0.08ms | **11.9±0.08ms** | **-0.83%** | | Large input file compilation (interpreter) | 46.3±0.70ms | 46.1±0.68ms | -0.43% | | Large nested iteration | 32.0±0.87ms | 32.3±0.38ms | +0.94% | | Perform Runtime Capabilities Analysis (RCA) on Deutsch-Jozsa sample | 1539.9±46.07µs | 1542.2±29.42µs | +0.15% | | Perform Runtime Capabilities Analysis (RCA) on large file sample | **7.7±0.07ms** | 7.8±0.06ms | **+1.30%** | | Perform Runtime Capabilities Analysis (RCA) on teleport sample | 1399.7±48.79µs | 1400.7±37.47µs | +0.07% | | Perform Runtime Capabilities Analysis (RCA) on the core and std libraries | 27.7±0.31ms | 27.8±0.30ms | +0.36% | | Teleport evaluation | 91.3±3.72µs | 91.5±4.13µs | +0.22% |
github-actions[bot] commented 13 hours ago

Benchmark for 8d3c660

Click to view benchmark | Test | Base | PR | % | |------|--------------|------------------|---| | Array append evaluation | 331.9±4.15µs | **326.0±2.19µs** | **-1.78%** | | Array literal evaluation | 189.6±0.84µs | **171.3±3.81µs** | **-9.65%** | | Array update evaluation | 417.9±9.37µs | **406.5±2.16µs** | **-2.73%** | | Core + Standard library compilation | 21.1±0.97ms | 20.5±0.62ms | -2.84% | | Deutsch-Jozsa evaluation | 5.2±0.06ms | **5.1±0.06ms** | **-1.92%** | | Large file parity evaluation | 34.5±0.15ms | 34.5±0.46ms | 0.00% | | Large input file compilation | 12.8±0.41ms | 12.6±0.42ms | -1.56% | | Large input file compilation (interpreter) | 50.9±1.90ms | 50.5±1.61ms | -0.79% | | Large nested iteration | 32.6±0.76ms | 32.0±1.39ms | -1.84% | | Perform Runtime Capabilities Analysis (RCA) on Deutsch-Jozsa sample | 1564.2±77.60µs | 1557.3±68.05µs | -0.44% | | Perform Runtime Capabilities Analysis (RCA) on large file sample | 7.9±0.11ms | 7.9±0.11ms | 0.00% | | Perform Runtime Capabilities Analysis (RCA) on teleport sample | 1419.1±46.99µs | 1428.9±84.01µs | +0.69% | | Perform Runtime Capabilities Analysis (RCA) on the core and std libraries | 28.3±0.27ms | 28.2±0.28ms | -0.35% | | Teleport evaluation | 92.8±3.47µs | 90.1±3.56µs | -2.91% |