Implement behavior to clean up numeric suffixes in exercise directories
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 38/100
Research direction
Start with the exercism doctor command and workspace.PotentialExercises(), then trace the download and submit commands. Done means suffixed exercise directories are grouped and interactively cleaned up, while download and submit reject suffixed directories with an error directing users to exercism doctor.
Written by the indexing model from the issue text.
Description
When we launched the v2 site, the CLI had some funky behavior that sometimes adds a numeric suffix to the exercise directory. This behavior is going away.
The exercism doctor command should clean any of these up.
We can rely on the workspace.PotentialExercises() functionality to do this, and then group them into each group of related exercises. E.g.
ruby/hello-worldruby/hello-world-2ruby/hello-world-3
These would all be in one group.
For each group where there are any exercises with a suffix we should have an interactive prompt. Something like:
Which one would you like to keep? Select your choice by typing the number.
1. hello-world
2. hello-world-2
3. hello-world-3
4. Skip this one. Do nothing and move on.
If they select one of the exercises (not skip), then:
- delete all but the selected one
- rename the selected one to remove the suffix (if it has one)
Additional error handling
In the download command we should bail with an error if trying to download to an exercise directory with a numeric suffix.
In the submit command we should bail with an error if trying to submit an exercise that is in a directory with a numeric suffix.
The error messages should suggest running exercism doctor.
- Dominant language
- Go
- Stars
- 1.4k
- Forks
- 363
- Avg merge
- 6d 13h
- Merged PRs (30d)
- 2
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from exercism/cli
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 38/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Fetch next exercise Open
Difficulty 4/5 3-5 days Newbie friendliness 25/100
Similar issues
-
needs-triage
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
bug carvel-triage
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
carvel-dev/kapp-controller#1861 ·
-
feature
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100