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

Revise styling of the output #226

Open
Martoon-00 opened this issue Nov 29, 2022 · 3 comments · May be fixed by #307
Open

Revise styling of the output #226

Martoon-00 opened this issue Nov 29, 2022 · 3 comments · May be fixed by #307
Milestone

Comments

@Martoon-00
Copy link
Member

Clarification and motivation

Look at the readme, at how the output looks like.

This is all subjective, but there are things that feel like a bad design of the style:

  • Names of bad files are given in gray, and they should on contrary stand out.
  • Those - before text, link, and anchor look redundant, especially after Avoid exotic unicode symbols #202.

Let's discuss all this and apply some fixes before the release.

Acceptance criteria

  • Some feedback on the styling is gathered.
  • Concrens are discussed.
  • On concerns we agreed upon - adjustements in the code are made.
@Martoon-00 Martoon-00 added this to the 0.3.0 milestone Nov 29, 2022
@aeqz
Copy link
Contributor

aeqz commented Jan 25, 2023

Some other things that we have recently detected:

  • We should review the indentation in some error cases. For example, the AnchorDoesNotExist similar anchors indentation seems to be excessive.
  • The redirect chain error formatting decreases readability. We can try showing in gray the indication attached at the end of a redirect chain (^-- Some text).

@aeqz
Copy link
Contributor

aeqz commented Jan 30, 2023

The ExternalResourceSomeError output seems too verbose:

  ➥  In file scripts/TranslationsScript/translations/PHPExcel/Documentation/markdown/Overview/01-Getting-Started.md
     bad reference (external) at src:55:4-88:
       - text: "http://www.ecma-international.org/news/TC45_current_work/TC45_available_docs.htm"
       - link: http://www.ecma-international.org/news/TC45_current_work/TC45_available_docs.htm

     ConnectionFailure Network.Socket.getAddrInfo (called with preferred socket type/protocol: AddrInfo {addrFlags = [], addrFamily = AF_UNSPEC, addrSocketType = Stream, addrProtocol = 0, addrAddress = 0.0.0.0:0, addrCanonName = Nothing}, host name: Just "www.ecma-international.org", service name: Just "80"): does not exist (nodename nor servname provided, or not known)

  ➥  In file scripts/TranslationsScript/translations/PHPExcel/Documentation/markdown/ReadingSpreadsheetFiles/01-File-Formats.md
     bad reference (external) at src:24:500-579:
       - text: "http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=office#technical"
       - link: http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=office
  
  ➥  In file scripts/TranslationsScript/translations/PHPExcel/Documentation/markdown/ReadingSpreadsheetFiles/01-File-Formats.md
     bad reference (external) at src:24:664-706:
       - text: "http://xml.openoffice.org/general.html"
       - link: http://xml.openoffice.org/general.html

     ConnectionFailure Network.Socket.getAddrInfo (called with preferred socket type/protocol: AddrInfo {addrFlags = [], addrFamily = AF_UNSPEC, addrSocketType = Stream, addrProtocol = 0, addrAddress = 0.0.0.0:0, addrCanonName = Nothing}, host name: Just "xml.openoffice.org", service name: Just "80"): does not exist (nodename nor servname provided, or not known)

  ➥  In file scripts/TranslationsScript/translations/PHPExcel/Documentation/markdown/ReadingSpreadsheetFiles/01-File-Formats.md
     bad reference (external) at src:32:291-360:
       - text: "http://projects.gnome.org/gnumeric/doc/file-format-gnumeric.shtml"
       - link: http://projects.gnome.org/gnumeric/doc/file-format-gnumeric.shtml

     ConnectionFailure Network.Socket.getAddrInfo (called with preferred socket type/protocol: AddrInfo {addrFlags = [], addrFamily = AF_UNSPEC, addrSocketType = Stream, addrProtocol = 0, addrAddress = 0.0.0.0:0, addrCanonName = Nothing}, host name: Just "projects.gnome.org", service name: Just "80"): does not exist (nodename nor servname provided, or not known)

It currently uses the HttpExceptionContent's Show instance. Maybe we could try to pattern match on it and show a human friendly message, at least for the most common exception cases.

@Martoon-00
Copy link
Member Author

Never seen such long error message there before, we really need to provide custom error message for cases like that 👍

@int-index int-index linked a pull request Nov 21, 2024 that will close this issue
13 tasks
int-index added a commit that referenced this issue Nov 21, 2024
* cli: avoid spaces in metavar
* errors: change formatting
* tests: accept new output
int-index added a commit that referenced this issue Nov 21, 2024
* cli: avoid spaces in metavar
* errors: change formatting
* tests: accept new output
int-index added a commit that referenced this issue Nov 23, 2024
Problem: multiple issues with the CLI output

1. In the --help output, metavars GLOB_PATTERN and REPOSITORY_TYPE
   used spaces instead of underscores. Variables typically don't
   contain spaces in their names, so it looked confusing.
2. Incorrect or unintuitive coloring of the output. For example,
   filenames were dim even though they're important and should
   stand out, the report of success wasn't green, error messages
   weren't red, etc.
3. Excessive indentation and empty lines that made it difficult to
   visually parse the error report. Also the use of the exotic '➥'
   character that looks bad in many font configurations.
4. Filenames and line numbers were far apart, making it impossible
   to Ctrl+Click to jump to the source of the error.
5. In case of connection failure, the output was too verbose and
   platform-dependent.

Solution:

1. Adjust the pretty-printing functions and update test output.
2. Extend VerifyError with a constructor for connection failures.
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 a pull request may close this issue.

2 participants