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

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

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 added 2 commits April 4, 2024 20:17
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

Fixes #546
Related to #271
@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.

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