Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

add_keyword.py 603 B

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
  1. from typing import Optional
  2. from bohrapi.artifacts import Commit
  3. from bohrapi.core import Heuristic
  4. from bohrlabels.core import OneOrManyLabels
  5. from bohrlabels.labels import CommitLabel
  6. @Heuristic(Commit)
  7. def add_keyword(commit: Commit) -> Optional[OneOrManyLabels]:
  8. """
  9. >>> res = add_keyword(Commit({"message": "MaxCount not working correctly in user/group query when"}))
  10. >>> res is None
  11. True
  12. >>> add_keyword(Commit({"message": "add unit-test"}))
  13. CommitLabel.NonBugFix
  14. """
  15. if commit.message.match_ngrams(["add"]):
  16. return CommitLabel.NonBugFix
  17. return None
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...