-
Notifications
You must be signed in to change notification settings - Fork 3
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
Declare exercises in toml files instead of d files #10
Conversation
Fixes #7 |
b716266
to
ace457f
Compare
source/app.d
Outdated
return; | ||
} | ||
|
||
immutable Exercise[] exercises = "exercises.toml".exercisesFromTOML(); |
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.
Since you are parsing UTF-8 text, you can handle a custom message like you done above for .toml
files that are not UTF-8 compliant.
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.
could you further explain?
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.
readText
throws an exception on bad UTF-8 reading. You can handle it to pretty print an error message rather than the default exception message + stacktrace, like you have done above.
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.
where is that information stated?
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.
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.
Does the current change look alright?
Wouldn't be interesting to parse TOML and use |
No. That invalidates the whole purpose of this change. What would be the difference between having the exercises defined as they were in |
Not importing the exercises itself, but rather just including the metadata. But it makes total sense nevertheless |
0bde995
to
9fc0fb8
Compare
Signed-off-by: João Lourenço <[email protected]>
Signed-off-by: João Lourenço <[email protected]>
5d9cc81
to
0e68c4d
Compare
update:
|
0e68c4d
to
b20071b
Compare
update:
|
b20071b
to
9af7467
Compare
"argparse": "~master", | ||
"fswatch": "0.6.0", | ||
"toml": "2.0.1", | ||
"unit-threaded": "2.0.5" |
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.
CC @WebFreak001 this shouldn't be there. I can make a PR if I have time.
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.
Humm, the dub config on toml seems correct 🤔 . Maybe its a behavior of dub, but I suppose this dependency doesn't affect the outer dependency, so no need to be version pinned, because it's only used internally. Perhaps have a dedicated internal-unittest
configuration on dub config?
Signed-off-by: João Lourenço <[email protected]>
Signed-off-by: João Lourenço <[email protected]>
Signed-off-by: João Lourenço <[email protected]>
9af7467
to
8a6a25f
Compare
update:
|
No description provided.