-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Added different colors for warning & error #11970
Conversation
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.
Hello @shikharvashistha! The PR still needs some work. The code does not compile and currently it does not really do what it's supposed to. Please see my comments below.
|
||
AnsiColorized SourceReferenceFormatter::infoColored() const | ||
{ | ||
return AnsiColorized(m_stream, m_colored, {BOLD, YELLOW}); |
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.
Why not WHITE
? Is that because you think it looks bad or is there some technical obstacle?
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.
The motivation was : In case we've white background then it would create difficulty. But as suggested by you I've changed it to white.
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 check how it looks like on white background then? To be more specific, we want to use the default foreground color. I think that terminals with white background will have it remapped to black or something else, but we should verify this.
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.
What about this? Have you checked it how it works in a white terminal?
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.
It's much better now, but still needs some tweaks.
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.
@shikharvashistha Could you please remove the formatting changes? It makes the PR rather hard to review now.
Greetings of the day @hrkrshnn , I'll remove the formatting. Actually it is caused by using clang-format file present in the source tree. Thanks & Regards |
a7bd411
to
2bd03ba
Compare
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 rebase it on top of develop
? We don't usually merge develop
into feature branches. Instead we use rebase workflow.
a697123
to
55467c1
Compare
Hi @cameel, apologies for closing this I've fixed/done the suggested changes |
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 see that your code contains syntax errors. They should be pretty obvious if you build the compiler locally. Do you need help doing that?
As a workaround for the CI not running here I have created a branch in our repo. You can see the results in workflow 19529. |
Thanks for the help extended for all the valuable inputs. |
As you can see, there are lots of CI checks that do not pass. You can see the results by clicking "Details". The PR needs to pass them all to be correct. |
I marked the PR as draft because it still needs some work. Please use the "Ready for review" button once all PR checks pass. Let me know if you need help with that. Also, I think it would be more convenient for you to run these tests locally (see Contributing > Running the Compiler Tests). |
Okay noted thanks |
You still have lots of syntax and style errors but overall the PR goes in a good direction so to help you out a bit I cleaned it and fixed the errors. Let's see if it passes tests now. Please take a look at it and see if you'd like to add anything. Then squash commits so that each one is a single logical change (without separate commits for PR fixes). |
I have fixed all the problems I pointed out.
Greetings of the day Mr @cameel, Thanks for the help extended for all the valuable inputs that made me learn new things and at the same time making this pull possible. Thanks & Regards |
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.
Looks good. Two minor questions. I'll squash the commits and approve the PR, since changes are not needed to merge this.
if (_input == formatErrorSeverityLowercase(severity)) | ||
return severity; | ||
|
||
return nullopt; |
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.
Shouldn't this be a throw? Fine either ways.
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.
No, because we sometimes do use other severity values. This should really be cleaned up in #11959 but for now we have to accept other values here.
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 see. My issues are basically resolved. Feel free to press merge if you wish :)
Co-authored-by: shikharvashistha <shikharvashistha@yandex.com> Co-authored-by: cameel <kamil.sliwak@codepoets.it>
@shikharvashistha Thanks for the PR and for all the follow ups. I'll merge the PR now. |
Greetings of the Mr. @hrkrshnn , Thanks for that label but I want to let you know that I didn't do it for hacktober fest 😂. Thanks & Regards |
So should we change the color for info ? to something visible, orange for example 🤔 @cameel |
Not really, it's not the info color that's the problem. We'd have to adjust colors to the terminal style somehow. It's harder to do and I'm not even sure if it's worth the effort (apparently not many people are using white terminals). I'd leave it as is unless someone complains. |
Ahh great. |
Fixes : #11962
Greetings of the day @cameel,
I've added different colors for waning and error. Please review the pr and let me know in case of any changes if required.
Thanks & Regards
Shikhar Vashistha