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

fix_keyword.py 639 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
21
  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 fix_keyword(commit: Commit) -> Optional[OneOrManyLabels]:
  8. """
  9. >>> from types import SimpleNamespace
  10. >>> res = fix_keyword(Commit({"message": "MaxCount not working correctly in user/group query when"}))
  11. >>> res is None
  12. True
  13. >>> fix_keyword(Commit({"message": "fix unit-test"}))
  14. CommitLabel.BugFix
  15. """
  16. if commit.message.match_ngrams(["fix"]):
  17. return CommitLabel.BugFix
  18. return None
Tip!

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

Comments

Loading...