Skip to content
This repository has been archived by the owner on Aug 18, 2020. It is now read-only.

Use word boundaries for vague terms separation #514

Merged
merged 1 commit into from
Jan 12, 2020

Conversation

YannCedric
Copy link
Contributor

Problem

The no-vague-titles rule on test statements is perhaps too general.
For most keywords, the rule matches sequences instead of words.

Example

If I use a variable that contains a blacklisted word like someVariableWithEveryInIt in my title , I get a no-vague-titles error because of every, even though I technically did not use the word every in my title.

Fix

Change the regular expressions to match words instead of sequences.
Instead of checking if the test statement contains a sequence, use regex's word boundaries to check if the string contains a word.

Similar to the way all is configured, only difference is the optional prefix/suffix.

Copy link
Contributor

@cartogram cartogram left a comment

Choose a reason for hiding this comment

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

💯 Thanks Yann!

@YannCedric YannCedric requested review from achinn and removed request for achinn and lemonmade January 12, 2020 19:59
@YannCedric YannCedric merged commit 5c3ce1b into master Jan 12, 2020
@YannCedric YannCedric deleted the more-specific-vague-words branch January 12, 2020 20:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants