oppia / oppia

A free, online learning platform to make quality education accessible for all.
https://www.oppia.org
Apache License 2.0
5.63k stars 3.78k forks source link

Feature Request: Colorise Errors in TypeScript Checks #20202

Open Akhilesh-max opened 3 weeks ago

Akhilesh-max commented 3 weeks ago

Is your feature request related to a problem? Please describe.

Currently, when running TypeScript checks using the command python -m scripts.run_typescript_checks --strict_checks, the errors are logged in the console without any color coding. This can make it difficult to distinguish between different types of messages and to identify errors quickly.

Describe the solution (or solutions) you'd like

It would be beneficial to colorise the error messages to improve readability and error identification. For instance, we could use red for errors, yellow for warnings, and green for successful messages.

Colorizing would help in:

Describe alternatives you've considered and rejected

No response

Additional context

No response

seanlip commented 2 weeks ago

@Akhilesh-max If the typescript check shows only the errors, do we need this functionality?

Akhilesh-max commented 2 weeks ago
Screenshot 2024-04-24 at 11 07 53 PM

True, only error messages are displayed. However, colorization may help us in distinguishing the error messages from file paths and line numbers. This could make the error messages stand out, thereby facilitating quicker identification and resolution. So, it's may be good to have, may not be much needed though.

seanlip commented 2 weeks ago

I think the key question is, what generates the logs? Is it the compiler or is it us?

If it's us, we can control the colour. If it is the typescript compiler then our ability to customize this might be limited (it should be possible to check the compiler command to see what options it allows).

If we need to do something like take the compiler output and manually parse it in order to colour it, then I think it's not worth doing this issue.