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

buggless_if_doc_extensions.py 850 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
22
23
24
25
  1. from typing import Optional
  2. from bohrapi.artifacts import Commit
  3. from bohrapi.core import Heuristic
  4. from bohrapi.util.extensiontypes import (
  5. code_extensions,
  6. doc_text_extensions,
  7. passive_code_extensions,
  8. )
  9. from bohrlabels.core import OneOrManyLabels
  10. from bohrlabels.labels import CommitLabel
  11. @Heuristic(Commit)
  12. def buggless_if_doc_extensions(commit: Commit) -> Optional[OneOrManyLabels]:
  13. file_found = False
  14. for file in commit.commit_files:
  15. if isinstance(file.filename, float):
  16. continue # TODO filename is NaN if it's not given <- needs to be fixed!
  17. if file.filename.split(".")[-1] not in doc_text_extensions:
  18. # TODO move filetype logic to CommitFile artifact?
  19. return None
  20. else:
  21. file_found = True
  22. return CommitLabel.NonBugFix if file_found else None
Tip!

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

Comments

Loading...