-
Notifications
You must be signed in to change notification settings - Fork 103
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
nevermind.py: Add caret in regex pattern #605
Conversation
Add caret in regex pattern so that 'corobo nm' and 'corobo nevermind' are matched only, and only then corobo says "I'm sorry :(". Thus, corobo would not respond with a sorry for commands where nm or nevermind appear anywhere in the command. Fixes coala#519
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.
Add tests to verify that the changes you made are working properly.
@jayvdb what does "!" In the beginning of "nevermind" mean in the test file? |
That is 'BOT_PREFIX' , just like we use 'corobo' as our bot's prefix. Go
through the documentation and you'll understand.
…On Mon 6 Aug, 2018, 11:15 AM Bhavya Srivastava, ***@***.***> wrote:
@jayvdb <https://github.com/jayvdb> what does "!" In the beginning of
"nevermind" mean in the test file?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#605 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ASansMihYVRaJcVouVKzrF6yhTWiFAxQks5uN9f4gaJpZM4Vvf3r>
.
|
Add '$' in regex pattern so that corobo only responds "I'm sorry :(" if it encounters "corobo nm" or "corobo nevermind", and does not respond with a sorry if there is anything after nm or nevermind. Also add unit test case for the change made. Fixes coala#519
Travis tests have failedHey @bhavya17037, 1st Buildcoala --non-interactive -V
python -m pytest
|
Sorry @TravisBuddy, you do not have the necessary permission levels to perform the action. |
Add $ sign in regex pattern so that anything after "nm" or "nevermind" is not matched. Fixes coala#519
Travis tests have failedHey @bhavya17037, 1st Buildcoala --non-interactive -V
|
@@ -8,7 +8,7 @@ class Nevermind(BotPlugin): | |||
Doesn't mind | |||
""" | |||
|
|||
@re_botcmd(pattern=r'(nm)|(nevermind)', flags=re.IGNORECASE) | |||
@re_botcmd(pattern=r'^(nm)$|^(nevermind)$', flags=re.IGNORECASE) |
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 better way r'^(?:nm|nevermind)$'
@bhavya17037 You have multiple commits, squash all your commits into a single one, refer http://api.coala.io/en/latest/Developers/Git_Basics.html#squashing-your-commits, don't close this PR. Also, fix errors reported by coala. |
@bhavya17037 Please read what I have said 😄 |
Add caret in regex pattern so that 'corobo nm' and 'corobo nevermind'
are matched only, and only then corobo says "I'm sorry :(".
Thus, corobo would not respond with a sorry for commands where nm
or nevermind appear anywhere in the command.
Fixes #519
Reviewers Checklist
botcmd
andre_botcmd
decorators.