-
-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add exercise generator #304
base: main
Are you sure you want to change the base?
Conversation
Hello. Thanks for opening a PR on Exercism. We are currently in a phase of our journey where we have paused community contributions to allow us to take a breather and redesign our community model. You can learn more in this blog post. As such, all issues and PRs in this repository are being automatically closed. That doesn't mean we're not interested in your ideas, or that if you're stuck on something we don't want to help. The best place to discuss things is with our community on the Exercism Community Forum. You can use this link to copy this into a new topic there. Note: If this PR has been pre-approved, please link back to this PR on the forum thread and a maintainer or staff member will reopen it. |
Sorry for the faux manipulation of adding the |
os.makedirs(docs) | ||
|
||
|
||
def create_meta_config(exercise_name, prob_spec_exercise, author): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Skimming this but configlet sync —filepaths —metadata -uye <exercise-slug>
would generate the config json so the only thing needed is update the author or contributor key
file.write("\n") | ||
|
||
|
||
def create_instructions(exercise_name, prob_spec_exercise): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’d rather have configlet sync the documents here to simplify the complexity.
) | ||
|
||
# If so, add the definition of the helper function to test returned errors | ||
if expect_errors: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we want to avoid checking exception messages because some students may use contracts instead so that won’t work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I based myself on collatz-conjecture-test.rkt
.
I guess using exn:fail?
is preferred then?
I was thinking about using Jinja templates like the Python track uses so the porter provides the templates needed to (re)create the stub, example, and tests. Would that work with what you had in mind? |
The reason I favor that approach is we can backport templates for already ported exercises and not break existing solutions. |
I never used Jinja, but I would be happy to look into it! If it's not easily adaptable from what I did here, it's not a problem. Feel free to close this PR if you think it's not a good starting point. It was more of a late day idea to "work less" to create the I'll try to take a look at the Python exercise generator after completing a few exercises for Hacktoberfest. 😉 |
Draft PRs are works in progress so no need to close unless you want me to. It's useful to keep this open to document what's been done so far. |
Seeing the number of exercises to implement for
protein-translation
, I saw big and started to port the Common Lisp exercise generator.There are still things to change and clean, but I was able to generate the files for the
protein-translation
exercise.I added TODOs inside the main file (
racket_exercise_generator.py
).Especially, I think the generator should use the configlet instead of mimicking it when possible.
I think it would be interesting to try it against a few already-implemented exercises, especially to evaluate the tests' generation.
What do you think? 😄