-
Notifications
You must be signed in to change notification settings - Fork 130
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
feat: Added support for ANSI Colours in Drifty CLI #329
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
Yeah! You did it 🎉 Now, Relax 😉, Grab a drink ☕, and wait for the maintainers to check your contributions. Meanwhile, you can discuss on other issues and solve them 😀. Thank You 😃!
Meanwhile you can also discuss about the project in our Discord Server 😀
trying to get rid of ES lint error by checkstyle
added white space in between added text for colour ex GREEN + insted of GREEN+
@J9414 Please comment in the issue so that I can assign you with the task. |
more chages as needed
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.
@J9414 I think it would be better to add ANSI colouring in MessageBroker
class. It can be included in the sendMessage()
method of that class.
Using the Message type (INFO, WARN, ERROR) in that method, colours can be added accordingly.
taking all chage back
as requested
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.
@J9414 Please make the requested changes 👇
- Please change tabs from 8 spaces to 4 spaces, in all code lines of MessageBroker class.
- Please use switch statement instead of if, for the colour determining code block. Also, add a default case for that switch block - which will be only the message which no colours.
as per new requrment added swich case and changed space in IDE for space
-- I did chages in IDE for space but i think still that is giving error |
updated
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.
@J9414 Please make the requested changes 👇
- Please keep the spaces in the GUI colour code block as it was before.
- In the default case, it will be
message = message
. - Please use enhanced switch case statements.
new update
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.
@J9414 Please use the switch statement like this 👇
message = switch (messageType) {
case INFO -> "\033[92m" + message + "\033[0m";
........
}
After applying this, please check once if everything works perfectly. There might be a missing semi-colon in the above sample code.
added messge = switch {.. };
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.
@J9414 Please commit the below requested changes.
as needed Co-authored-by: Saptarshi Sarkar <[email protected]>
Co-authored-by: Saptarshi Sarkar <[email protected]>
Co-authored-by: Saptarshi Sarkar <[email protected]>
Co-authored-by: Saptarshi Sarkar <[email protected]>
thanks for suggesting, i will try to improve on it |
Welcome 😁. |
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.
@J9414 The colour codes doesn't seem to work as they are different as compared to the one given here. Please check once and make the requested changes.
Also, please post two screenshots one for normal coloured lines and the other for coloured bold lines.
This was my first pr and i managed to actually add some input thanks again and i added new screen shots |
the colour i added are in // High Intensity section so i thout it would look much batter on CLI black background |
@J9414 It's okay. No problem. I haven't checked the High Intensity section. Sorry for that. |
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 to merge 👍.
Thanks for contributing 🚀 🚀.
You may join our Discord server - https://discord.gg/DeT4jXPfkG to get updates about the project.
Fixes issue
Fixes #284
Changes proposed
As you suggested, colors for each message type are:
INFO: Blue or Green
WARN: Yellow
ERROR: Red
Screenshots
Note to reviewers
No response