Skip to content

Conversation

richardlau
Copy link
Member

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

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

richardlau commented Apr 16, 2019

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
Copy link
Member Author

This is how it looks in an actual console:
image

if (!~subs.indexOf(sub)) {
failed = true
let suggestion = ''
const suggestions = new FuzzySet(subs).get(sub)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A small suggestion. It might be better to create the FuzzySet once instead of creating it for every iteration of the for loop.

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.

3 participants