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

add synonyms linter #447

Merged
merged 2 commits into from
Jun 15, 2020
Merged

add synonyms linter #447

merged 2 commits into from
Jun 15, 2020

Conversation

missinglink
Copy link
Member

@missinglink missinglink commented Jun 12, 2020

This PR (extracted from #446) adds a linter which is designed to help users avoid making common mistakes when adding synonyms.

 * The synonyms linter attempts to warn the user when making
 * common mistakes with synonyms.
 *
 * Warnings:
 *  - Puntuation: Synonyms should not contain characters in the punctuation blacklist
 *  - Letter Casing: Synonyms should be lowercase
 *  - Sanity Checks: At least one synonym should exist, duplicates should be removed
 *  - Multi Word: Multi-word synonyms can generate unexpected token positions

As part of this I noticed that some of the existing synonyms contained punctuation in the blacklist, these synonyms would surely never match and so can be removed.

I've added a multiWordCheck linter which is currently commented out, I didn't want to cross that bridge yet.

@orangejulius
Copy link
Member

Nice, this is really awesome!

@missinglink
Copy link
Member Author

Cool, I think i'll merge this today.

@orangejulius one thing I would consider changing before merging are the log messages.
I'd like to make sure that for users who specify custom synonyms that the warnings make sense and are actionable without having to open issues.

What do you think? Do you think the warnings might be misinterpreted as errors?

@missinglink missinglink merged commit fd91ccf into master Jun 15, 2020
@missinglink missinglink deleted the synonyms_linter branch June 15, 2020 11:02
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