qdk icon indicating copy to clipboard operation
qdk copied to clipboard

Q# New Lints Ideas/Proposals

Open orpuente-MS opened this issue 1 year ago • 1 comments

This issue is a place to gather ideas/proposals for new lints.

Future lints:

  • Dead Code
  • Shadowing a mutable variable with an immutable variable of the same type
  • Having a callable named Main and a separate callable with the @EntryPoint() attribute can be confusing to readers
  • Variable declared as mutable but never updated can be switched to let declaration.

Quantum Specific Lints:

  • Gates that are identities if they are squared.
  • Measure a qubit that hasn't had gates applied to it.
  • Don't reset qubits when it is not needed.
  • Operations that don't manipulate qubits can be functions instead of operations.
  • When qubit reuse is not supported, prefer MResetZ over M
  • Operations with implemented specializations that are missing from the signature.
  • Use of deprecated using syntax could have lint that suggests use syntax

RCA Lints:

  • Avoid callables that can only be resolved at runtime, aka CallToUnresolvedCallee

Current Lints:

  • DivisionByZero
  • NeedlessParens
  • RedundantSemicolons

orpuente-MS avatar Mar 28 '24 21:03 orpuente-MS

@orpuente-MS please assign the task to me!

saram-aman avatar Apr 12 '24 12:04 saram-aman