microsoft / microsoft/qdk

Simplify solution ID generation in katas

Open
#1,729 0 comments 0 reactions 1 assignee Claimed by @cesarzc View on GitHub
enhancement low-priority
Dominant language
Rust
Stars
1k
Forks
212
Avg merge
3d 8h
Merged PRs (30d)
65

Description

**Is your feature request related to a problem? Please describe.**
Ids of solutions in the katas contain effectively duplicate information, and I tend to forget to update ids when copy-pasting exercises from existing ones to use as a starting point, so have to go back and update when build fails.

**Describe the solution you'd like**
The id of a solution can be deduced as `_`. We have two scenarios:

1. File is just `Solution.qs` (tasks with one solution) - can use file name as is, converted to lowercase
```
@[solution]({
"id": "solving_sat__sat_formula_solution",
"codePath": "./Solution.qs"
})
```

2. File name is SolutionA/SolutionB - can either modify the id pattern to make it end with `_solutiona` (filename converted to lowercase) or separate "solution" from the suffix it uses for uniqueness with an underscore.
```
@[solution]({
"id": "preparing_states__two_bitstrings_solution_a",
"codePath": "./SolutionA.qs"
})
```

With this change, `@[solution]` macro won't need "id" field any longer.

@cesarzc Let me know what you think about this!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.