Repository navigation
Use re.findall() instead of re.search() in message_listener_matches - #387
Conversation
Using re.findall() provides better match results in cases where the programmer would like to match the same group multiple times in a single chat message, which would previously only return a single result. Behavior for existing use cases, such as matching two different groups, continues to return a tuple that matches the old behavior or re.search().groups() for backward compatibility
|
Hi @albeec13, thanks a lot for submitting this PR as well! Before reviewing the changes, can I ask you to add new test patterns in the following test files? You can use the scripts under the
If creating new test files having |
Codecov Report
@@ Coverage Diff @@
## main #387 +/- ##
=======================================
Coverage 91.59% 91.60%
=======================================
Files 167 167
Lines 5378 5384 +6
=======================================
+ Hits 4926 4932 +6
Misses 452 452
Continue to review full report at Codecov.
|
I've pushed new test cases and validated that they fail before and succeed after the changes in this PR. Should be good to go. |
seratch
left a comment
There was a problem hiding this comment.
Perfect! Looks great to me 👍
Using re.findall() provides better match results in cases where the programmer would like to match the same group multiple times in a single chat message, which would previously only return a single result. Behavior for existing use cases, such as matching two different groups, continues to return a tuple that matches the old behavior or re.search().groups() for backward compatibility. This fixes issue #386
(Describe the goal of this PR. Mention any related Issue numbers)
Category (place an
xin each of the[ ])slack_bolt.Appand/or its core componentsslack_bolt.async_app.AsyncAppand/or its core componentsslack_bolt.adapter/docsRequirements (place an
xin each[ ])Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.
./scripts/install_all_and_run_tests.shafter making the changes.