microsoft / microsoft/qdk

Q# New Lints Ideas/Proposals

Open
#1,333 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Rust
Stars
1k
Forks
212
Avg merge
3d 8h
Merged PRs (30d)
65

Description

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

## Lint ideas:
- 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:
- Sequence of gates that are equivalent to the identity gate.
- 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`

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the proposed lint ideas and compare them with the current lints listed in the issue. No file, test, or entry point is identified, so a specific lint and implementation scope must be selected before work can begin. Done would require a concrete proposal with a defined implementation and validation plan.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.