core-validate-commit
core-validate-commit copied to clipboard
lib: add suggestions on invalid subsystems
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
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).
This is how it looks in an actual console:
