microsoft / microsoft/qdk

Surface a warning or error if `src/` does not contain any `.qs` files as direct children

Open
#1,516 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

As of #1416, if you are using implicit namespaces and nesting all of your source files deeply in the project, in the same nested directory, e.g. project/src/Microsoft/Quantum/Canon.qs and project/src/Microsoft/Quantum/Diagnostics.qs, you will experience non-intuitive behavior where the namespace detected will only be the final segment of the path (Canon and Diagnostics), not the full path Microsoft.Quantum.___. We should detect this and throw an error or warning.

Adding this to the linter may be difficult as the linter currently only has access to the AST, HIR, and FIR. So, this will likely have to be an error originating from the parser itself.

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

Start by tracing the parser path for implicit namespaces and how it discovers source files under src/. Confirm the behavior with nested .qs files and with no direct-child .qs files. Done means the project emits a warning or error for the latter case and preserves the intended namespace behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.