-
Notifications
You must be signed in to change notification settings - Fork 50
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
lib: add suggestions on invalid subsystems #58
base: main
Are you sure you want to change the base?
Conversation
When an invalid subsystem is encountered, attempt to make a suggestion based on the nearest match (if any) from the valid subsystems.
aa3a0f2
to
28b7f63
Compare
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 |
@@ -111,11 +113,16 @@ module.exports = { | |||
for (const sub of parsed.subsystems) { | |||
if (!~subs.indexOf(sub)) { | |||
failed = true | |||
let suggestion = '' | |||
const suggestions = new FuzzySet(subs).get(sub) |
There was a problem hiding this comment.
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.
When an invalid subsystem is encountered, attempt to make a suggestion
based on the nearest match (if any) from the valid subsystems.
Example: