hedyorg / hedy

Hedy is a gradual programming language to teach children programming. Gradual languages use different language levels, where each level adds new concepts and syntactic complexity. At the end of the Hedy level sequence, kids master a subset of syntactically valid Python.
https://www.hedy.org
European Union Public License 1.2
1.3k stars 285 forks source link

📜 Improve error message structure and consistency #5616

Closed ArtV11 closed 3 months ago

ArtV11 commented 3 months ago

This pull request is part of a larger project in which we are redesigning our error messages according to these guidelines.

In this PR, I have worked on the redesigning topic (i) Structure. We aim to follow a consistent structure for all of our error messages. First sentence will inform our users of the issue, while the second sentence will offer a suggestion on how to resolve it. This approach helps users quickly understand where to look when something goes wrong and allows them to become accustomed to reading the error messages more efficiently due to their uniform structure. I added a suggestion on how to fix the problem for every error message while at it I also worked on (ii) Consistency. We aim to keep our error messages consistent by using the uniform wording and maintaining a similar sentence structure and length. Errors should follow the same format ensuring that the sentences start and end similarly. This consistency also aids in the readability and the structure of the error messages. because I was already creating new sentences while adding the suggestion and wanted to keep their wording consistent but the consistency aspect still needs some work for the future work.

Addresses https://github.com/hedyorg/hedy/issues/5012

Felienne commented 3 months ago

I like the new structure, thanks! Will we do wording (like Insufficient) in this PR too? Otherwise it will block us from deploying.

Also (I am sure you know) tests are still failing, can you take a look?

Felienne commented 3 months ago

Hi @jpelay!

I am ok with all these changes, I am just not sure about the backtick doing what you think it does. If you can confirm it does, you may approve!

Felienne commented 3 months ago

Hi @jpelay!

I am ok with all these changes, I am just not sure about the backtick doing what you think it does. If you can confirm it does, you may approve!

Never mind, all cleared up now!

mergify[bot] commented 3 months ago

Thank you for contributing! Your pull request is now going on the merge train (choo choo! Do not click update from main anymore, and be sure to allow changes to be pushed to your fork).

mergify[bot] commented 3 months ago

Thank you for contributing! Your pull request is now going on the merge train (choo choo! Do not click update from main anymore, and be sure to allow changes to be pushed to your fork).

jpelay commented 3 months ago

I am ok with all these changes, I am just not sure about the backtick doing what you think it does. If you can confirm it does, you may approve!

Ohh sorry :c, I thought the backticks were necessary to show words as code in the error messages. What are they meant to do?

Felienne commented 3 months ago

I am ok with all these changes, I am just not sure about the backtick doing what you think it does. If you can confirm it does, you may approve!

Ohh sorry :c, I thought the backticks were necessary to show words as code in the error messages. What are they meant to do?

I don't remember! ~Someone should read to code to figure it out :)~

Ok, I dove in a bit. I think you are right, partly, it does work like that, but there is also back-end magic involved as I thought, see here:

https://github.com/hedyorg/hedy/blob/063d197f5eb75b5c0505630129044b9a777f610f/hedy_error.py#L63

So it is not like just simple `` in markdown, which is what I remembered.

jpelay commented 3 months ago

Ok, I dove in a bit. I think you are right, partly, it does work like that, but there is also back-end magic involved as I thought, see here:

https://github.com/hedyorg/hedy/blob/063d197f5eb75b5c0505630129044b9a777f610f/hedy_error.py#L63

So it is not like just simple `` in markdown, which is what I remembered.

Ahhhhh, I see! Thanks for clarifying!