-
Notifications
You must be signed in to change notification settings - Fork 11
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
Improve mdox
UX
#49
Improve mdox
UX
#49
Conversation
Signed-off-by: Saswata Mukherjee <saswataminsta@yahoo.com>
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.
LGTM, just style nit 🤗
pkg/mdformatter/mdformatter.go
Outdated
if spin != nil { | ||
err := spin.Stop() | ||
if err != nil { | ||
errs.Add(err) | ||
} | ||
} |
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.
if spin != nil { | |
err := spin.Stop() | |
if err != nil { | |
errs.Add(err) | |
} | |
} | |
if spin != nil { | |
errs.Add(spin.Stop()) | |
} |
Add checks error already
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.
Sure!
pkg/mdformatter/mdformatter.go
Outdated
f := New(ctx, opts...) | ||
b := bytes.Buffer{} | ||
if spin != nil { | ||
err := spin.Start() |
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.
ditto
Signed-off-by: Saswata Mukherjee <saswataminsta@yahoo.com>
This PR adds a cli spinner with description for
mdox fmt
command and adds colored diff formdox fmt --check
command.This does not change CI logs and only affects output when run on a terminal.
Dependencies added: glamour, yacspin, go-isatty.
Screenshots attached below.
For
mdox fmt
:For diffs: