core-validate-commit icon indicating copy to clipboard operation
core-validate-commit copied to clipboard

lib: add suggestions on invalid subsystems

Open richardlau opened this issue 6 years ago • 2 comments

When an invalid subsystem is encountered, attempt to make a suggestion based on the nearest match (if any) from the valid subsystems.

Example:

     ✔  0:0      skipping fixes-url                        fixes-url
     ✔  0:0      blank line after title                    line-after-title
     ✔  0:0      line-lengths are valid                    line-length
     ✖  0:0      Invalid subsystem: "error", did you mean "errors"? subsystem
     ✔  0:0      Title is formatted correctly.             title-format
     ✔  0:0      Title is <= 50 columns.                   title-length

richardlau avatar Apr 16 '19 08:04 richardlau

Can we wrap this somehow? It currently breaks the table.

Updated. Now looks like this:

     ✔  0:0      skipping fixes-url                        fixes-url
     ✔  0:0      blank line after title                    line-after-title
     ✔  0:0      line-lengths are valid                    line-length
     ✖  0:0      Invalid subsystem: "error"                subsystem
                 Did you mean "errors"?
     ✔  0:0      Title is formatted correctly.             title-format
     ✔  0:0      Title is <= 50 columns.                   title-length

(Not sure why GitHub isn't aligning the Did you mean "errors"? line -- It's lined up properly on my Linux and Windows consoles. EDIT: ah it looks like the tick/cross glyphs are rendering at a different width, at least for me in Firefox on Windows).

richardlau avatar Apr 16 '19 10:04 richardlau

This is how it looks in an actual console: image

richardlau avatar Apr 16 '19 11:04 richardlau