Skip to content
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

Add response formatter; refactor stats formatter #1398

Merged
merged 17 commits into from
Jun 14, 2024
Merged

Add response formatter; refactor stats formatter #1398

merged 17 commits into from
Jun 14, 2024

Conversation

mre
Copy link
Member

@mre mre commented Apr 4, 2024

Summary

This adds support for formatting responses in different ways. For now the options are

  • plain: No color, basic formatting
  • color: Color, indented formatting (default)
  • emoji: Fancy mode with emoji icons

Sample output

--mode color (default)

image

--mode color -vv (verbose debug output)

image

--mode emoji

image

--mode plain

image

Related issues

Fixes #546
Related to #271

@alexanderbazhenoff fyi

@mre mre requested a review from thomas-zahner April 4, 2024 10:06
@mre mre mentioned this pull request Apr 4, 2024
@mre mre force-pushed the status-format branch 2 times, most recently from 0a68ae9 to 9a8d236 Compare April 4, 2024 10:42
@thomas-zahner
Copy link
Member

@mre Code-wise this PR looks good 👍

The summary (see below) which is printed in the end still shows emojis, is this not part of #546 and this PR?

🔍 2 Total (in 0s) ✅ 1 OK 🚫 1 Error

lychee-bin/src/options.rs Outdated Show resolved Hide resolved
lychee-bin/src/formatters/log.rs Outdated Show resolved Hide resolved
lychee-bin/src/main.rs Show resolved Hide resolved
lychee-bin/src/stats.rs Outdated Show resolved Hide resolved
lychee-bin/src/options.rs Outdated Show resolved Hide resolved
lychee-bin/src/formatters/response.rs Outdated Show resolved Hide resolved
@mre
Copy link
Member Author

mre commented Apr 4, 2024

The summary (see below) which is printed in the end still shows emojis, is this not part of #546 and this PR?

Oh, nice catch. Maybe I should fix that. Then again, I'm not sure if it will be tough, because I have to pass that information to the StatusFormatter. 🤔

@mre
Copy link
Member Author

mre commented Apr 6, 2024

Maybe I should add some tests before this can be merged.

@mre mre merged commit dedc554 into master Jun 14, 2024
7 checks passed
@mre mre deleted the status-format branch June 14, 2024 17:47
@mre
Copy link
Member Author

mre commented Jun 14, 2024

Finally got around to merging this!
Thanks for the review, @thomas-zahner.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for no-colors and no-emoticons output
2 participants