-
Notifications
You must be signed in to change notification settings - Fork 5.7k
fix: make gender input case-insensitive and clean up pre-commit config #4855
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
base: master
Are you sure you want to change the base?
fix: make gender input case-insensitive and clean up pre-commit config #4855
Conversation
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.
Thanks for the PR!
@@ -145,7 +145,7 @@ def main() -> None: | |||
conv_handler = ConversationHandler( | |||
entry_points=[CommandHandler("start", start)], | |||
states={ | |||
GENDER: [MessageHandler(filters.Regex("^(Boy|Girl|Other)$"), gender)], | |||
GENDER: [MessageHandler(filters.Regex("(?i)^(Boy|Girl|Other)$"), gender)], |
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 a comment saying that this is a case-insensitive
can not pass CI. output looks like
|
I'm not sure what could be causing that. Maybe run: |
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.
Kindly also add a new file changes/unreleased/4855.8hCFRFMeMaRWpBEYaxrTMq.toml
with the following content:
other= "Make Gender Input Case-Insensitive in ``conversationbot.py``"
[[pull_requests]]
uid = "4855"
author_uid = "fengxiaohu"
closes_threads = ["4846"]
.pre-commit-config.yaml
Outdated
@@ -80,4 +80,4 @@ repos: | |||
name: isort | |||
args: | |||
- --diff | |||
- --check | |||
- --check |
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.
please add an empty newline at the end of the file to completely revert your changes
Summary
This PR improves the gender input handling in
examples/conversationbot.py
by using a case-insensitive regex.It also corrects a pre-commit hook configuration issue in
.pre-commit-config.yaml
(invalidstages
field inisort
).Changes
(?i)
regex..pre-commit-config.yaml
to fixisort
hook crash due to invalid stages.ruff
,black
,flake8
,isort
, andmypy
.Check-list
pre-commit run -a
).. versionchanged:: NEXT.VERSION
to example function (optional)AUTHORS.rst
(optional)